# Filter operators

`Query*` endpoints accept a `filter_conditions` body. Equality is bare; everything else wraps the value in an operator object. The vocabulary is the same one the SDKs use, so a filter that works in an SDK works in the CLI unchanged.

## Operators

| Operator                | Meaning                               |
| ----------------------- | ------------------------------------- |
| `$eq` / `$ne`           | Equal / not equal                     |
| `$gt` / `$gte`          | Greater than / greater or equal       |
| `$lt` / `$lte`          | Less than / less or equal             |
| `$in` / `$nin`          | Value is / isn't in array             |
| `$exists`               | Field is present (bool)               |
| `$contains`             | Array contains value                  |
| `$autocomplete`         | Prefix match on strings               |
| `$q`                    | Full-text search                      |
| `$and` / `$or` / `$nor` | All / any / none of the clauses match |

## Equality

Bare values mean `$eq`:

```json
{ "type": "messaging" }
```

Equivalent to:

```json
{ "type": { "$eq": "messaging" } }
```

## Composition

```json
{
  "$and": [
    { "type": "messaging" },
    { "member_count": { "$gte": 50 } },
    { "members": { "$in": ["alice"] } }
  ]
}
```

## Sorting

```json
"sort": [
  { "field": "member_count",    "direction": -1 },
  { "field": "last_message_at", "direction": -1 }
]
```

`1` is ascending, `-1` is descending. Multiple sorts apply in order.

## Field support

Not every field supports every operator. The set of supported operators is per-endpoint and per-field; check the schema for the endpoint, which lists the operators each field accepts:

```bash
getstream api QueryChannels --schema
```

## See also

- [Query data](https://getstream.io/cli/docs/query-data/): how-to recipes built on these operators
- [`getstream api` reference](https://getstream.io/cli/docs/commands/api/): the command that takes these bodies
- [Query syntax operators](https://getstream.io/docs/platform/query-syntax-operators/): the same vocabulary in the SDK docs

---

For the most recent version of this documentation, visit [https://getstream.io/cli/docs/reference/filter-operators/](https://getstream.io/cli/docs/reference/filter-operators/).