> For the complete documentation index, see [llms.txt](https://motivlabs.gitbook.io/impulse-user-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://motivlabs.gitbook.io/impulse-user-manual/content-manipulators-motators/liquid-field/basics/operators.md).

# Operators

## Operators

Liquid includes many logical and comparison operators. You can use operators to create logic with [control flow](/impulse-user-manual/content-manipulators-motators/liquid-field/tags/control-flow.md) tags.

### Basic operators <a href="#basic-operators" id="basic-operators"></a>

| `==`  | equals                   |
| ----- | ------------------------ |
| `!=`  | does not equal           |
| `>`   | greater than             |
| `<`   | less than                |
| `>=`  | greater than or equal to |
| `<=`  | less than or equal to    |
| `or`  | logical or               |
| `and` | logical and              |

For example:

```
{% if product.title == "Awesome Shoes" %}
  These shoes are awesome!
{% endif %}
```

You can do multiple comparisons in a tag using the `and` and `or` operators:

```
{% if product.type == "Shirt" or product.type == "Shoes" %}
  This is a shirt or a pair of shoes.
{% endif %}
```

### contains <a href="#contains" id="contains"></a>

`contains` checks for the presence of a substring inside a string.

```
{% if product.title contains "Pack" %}
  This product's title contains the word Pack.
{% endif %}
```

`contains` can also check for the presence of a string in an array of strings.

```
{% if product.tags contains "Hello" %}
  This product has been tagged with "Hello".
{% endif %}
```

`contains` can only search strings. You cannot use it to check for an object in an array of objects.

### Order of operations <a href="#order-of-operations" id="order-of-operations"></a>

In tags with more than one `and` or `or` operator, operators are checked in order *from right to left*. You cannot change the order of operations using parentheses — parentheses are invalid characters in Liquid and will prevent your tags from working.

```
{% if true or false and false %}
  This evaluates to true, since the `and` condition is checked first.
{% endif %}
```

```
{% if true and false and false or true %}
  This evaluates to false, since the tags are checked like this:

  true and (false and (false or true))
  true and (false and true)
  true and false
  false
{% endif %}
```


---

# 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:

```
GET https://motivlabs.gitbook.io/impulse-user-manual/content-manipulators-motators/liquid-field/basics/operators.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
