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:
{ "type": "messaging" }Equivalent to:
{ "type": { "$eq": "messaging" } }Composition
{
"$and": [
{ "type": "messaging" },
{ "member_count": { "$gte": 50 } },
{ "members": { "$in": ["alice"] } }
]
}Sorting
"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:
getstream api QueryChannels --schemaSee also
- Query data: how-to recipes built on these operators
getstream apireference: the command that takes these bodies- Query syntax operators: the same vocabulary in the SDK docs