> ## 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 by metadata.

A filter keeps only documents whose metadata matches. `{ "key": value }` means equals:

```json theme={null}
{ "team": "support" }
```

## Operators

| Operator | Matches |
| - | - |
| `$eq` | equal to |
| `$ne` | not equal to |
| `$gt`, `$gte` | greater than, greater than or equal |
| `$lt`, `$lte` | less than, less than or equal |
| `$in` | equal to any value in the list |
| `$nin` | equal to none of the values in the list |

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

## Combine

Combine conditions with `$and` and `$or` arrays:

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

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

In TypeScript, filters are typed:

```ts theme={null}
import type { Filter } from "conare";

const filter: Filter = { $or: [{ team: "support" }, { year: { $gte: 2024 } }] };
await docs.query("refunds", { filter });
```
