> For the complete documentation index, see [llms.txt](https://docs.documint.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.documint.me/templates/working-with-dynamic-data/functions-and-operators/operators/comparison-operators.md).

# Comparison Operators

### eq

`{{$eq value1 value2}}`

Evaluates to `true` if `value1` is **equal to** `value2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>value1</td><td>A static value or a variable path</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number, </span><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr><tr><td>value2</td><td>A static value or a variable path</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number, </span><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types.md#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($eq category "sports") }}Category is sports{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "category":"sports"
}
```

{% endtab %}

{% tab title="Result" %}
Category is sports
{% endtab %}
{% endtabs %}

### ne

`{{$ne value1 value2}}`

Evaluates to `true` if `value1` is **not equal to** `value2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>value1</td><td>A static value or a variable path</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number, </span><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr><tr><td>value2</td><td>A static value or a variable path</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number, </span><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types.md#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($ne category "sports") }}Category is not sports{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "category":"sports"
}
```

{% endtab %}

{% tab title="Result" %}
This is a sports category
{% endtab %}
{% endtabs %}

### gt

`{{$gt number1 number2}}`

Evaluates to `true` if `number1` is **greater than** the `number2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr></tbody></table>

**Returns**

*(*[*Boolean*](/legacy-documentation/data-and-variables/data-types.md#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($gt grand\_total 1500) }}Grand total is greater than 1500{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "grand_total": 1600
}
```

{% endtab %}

{% tab title="Result" %}
Grand total is greater than 1500
{% endtab %}
{% endtabs %}

### lt

`{{$lt number1 number2}}`

Evaluates to `true` if `number1` is **less than** `number2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; ([*Boolean*](/legacy-documentation/data-and-variables/data-types.md#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($lt score 50) }}Score is less than 50{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "score": 25
}
```

{% endtab %}

{% tab title="Result" %}
Score is less than 50
{% endtab %}
{% endtabs %}

### gte

`{{$gte number1 number2}}`

Evaluates to `true` if `number1` is **greater than or equal to** `number2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types.md#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($gte score 50) }}Score is greater than or equal to 50{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "score": 50
}
```

{% endtab %}

{% tab title="Result" %}
Score is greater than or equal to 50
{% endtab %}
{% endtabs %}

### lte

`{{$lte number1 number2}}`

Evaluates to `true` if `number1` is **less than or equal to** `number2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types.md#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($lte score 50) }}Score is less than or equal to 50{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "score":50
}
```

{% endtab %}

{% tab title="Result" %}
Content to display for sports
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.documint.me/templates/working-with-dynamic-data/functions-and-operators/operators/comparison-operators.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
