> ## Documentation Index
> Fetch the complete documentation index at: https://docs.conare.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Filters

> Narrow a query or a delete by metadata.

A filter matches documents by their [metadata](/write#metadata). Pass it as `filter` to a
[query](/query) or a [delete](/delete#delete-many).

```json theme={null}
{ "team": "support", "year": { "$gte": 2024 } }
```

## Equality

A value matches metadata equal to it, or an array that holds it:

```json theme={null}
{ "tags": "billing" }
```

This matches `"tags": "billing"` and `"tags": ["billing", "refunds"]`. Equality compares as text,
so `3`, `3.0` and `"3"` match one another.

`$in` matches any value in a list:

```json theme={null}
{ "lang": { "$in": ["en", "de"] } }
```

## Ranges

`$gt`, `$gte`, `$lt` and `$lte` compare numbers with numbers and strings with strings:

```json theme={null}
{ "price": { "$gte": 10, "$lt": 100 } }
```

Strings compare byte by byte, so ISO 8601 dates sort correctly:

```json theme={null}
{ "published_at": { "$gte": "2025-06-01" } }
```

* Booleans and array items never match a range.
* A string longer than about 220 bytes never matches a range, and a bound that long returns
  `400 invalid_filter`.
* Documents written before October 3, 2026 match ranges only once they're written again.

## And, or

Keys in one object must all match. `$or` matches any of its filters, and `$and` all of them:

```json theme={null}
{
  "$or": [
    { "team": "support" },
    { "year": { "$in": [2024, 2025] } }
  ]
}
```

## Operators

| Operator | Matches |
| - | - |
| `{ "key": value }` or `$eq` | Equal to the value |
| `$in` | Equal to any value in the list |
| `$gt`, `$gte`, `$lt`, `$lte` | Greater than, at least, less than, at most |
| `$and`, `$or` | All, or any, of a list of filters |

There is no "not equal" (`$ne`, `$nin`).

## Limits

* Up to 256 conditions, nested up to 8 levels. `$in` takes up to 255 values.
* Filter keys aren't checked: a misspelled key matches nothing.
* An invalid filter returns `400 invalid_filter`, and `message` says what's wrong.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.