# The filters block

The filters block contains information on how the layer is being filtered before displaying. In order for a feature to be shown on the map it must evaluate the filter expression to `true`.

Filters are written using a JSON infix notation that looks like one of `[identifier, operator, operand]`, `true` or `false` .

* Valid identifiers are either a feature property or a nested expression.
* Valid operators are:
  * `"lt"` – Less than
  * `"gt"` – Greater than
  * `"le"` – Less than or equal to
  * `"ge"` – Greater than or equal to
  * `"eq"` – Equal to
  * `"ne"` – Not equal to
  * `"and"` – And, cast to boolean
  * `"or"` – Or, cast to boolean
  * `"cn"` – Contains the operand, cast to string
  * `"nc"` – Does not contain the operand, cast to string
  * `"in"` – Contained in the operand list
  * `"ni"` – Not contained in the operand list
  * `"is"` – Used to match against null values
  * `"isnt"` – Used to match against null values
* Operands are:
  * A numerical value, a string value, a boolean value
  * An array of numerical, string, or boolean values, a shorthand expanded to these patterns:
    * Input 1: `[id, "in", [element1, …, elementN]`
    * Expansion 1: `id` is equal (`”eq”`) to one of more of the elements
    * Input 2: `[id, "ni", [element1, …, elementN]`
    * Expansion 2: `id` is not equal (`”ne”`) to any of the elements
    * Not defined for operators other than `"in"` and `"ni"`
  * A nested expression
* In cases of type mismatch cast the identifier value to the operand’s type
  * Type casting applies element-wise to lists with `"in"` and `"ni"` operators

{% code title="Example of a filter block that filters out features with a value less than 50000 on the “acres” property" %}

```jsx
"filters": ["acres", "lt", 50000]
```

{% endcode %}

{% code title="Example of a more complex filter block" %}

```jsx
"filters": [["acres", "ge", 50000], "and", ["acres", "le", 70000]]
```

{% endcode %}


---

# Agent Instructions: 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://developers.felt.com/felt-style-language/style-definition-blocks/the-filters-block.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.
