Filter operators
| Operator | Description | Supported types |
|---|---|---|
$eq | Equal to a specified value | String, number, boolean |
$ne | Not equal to a specified value | String, number, boolean |
$gt | Greater than a specified value | Number |
$gte | Greater than or equal to a specified value | Number |
$lt | Less than a specified value | Number |
$lte | Less than or equal to a specified value | Number |
$in | Matches any value in an array | String, number |
$nin | Matches none of the values in an array | String, number |
$all | Matches arrays containing all specified elements | Array |
$elemMatch | Matches if any array element meets the criteria | Array |
$exists | Matches documents where the field exists | Boolean |
$and | Joins clauses with logical AND | - |
$or | Joins clauses with logical OR | - |
$not | Negates a filter expression | - |
$nor | Matches documents that fail all specified conditions | - |
Basic filtering
Pass afilter object to return only documents with matching metadata values.
Using comparison operators
Range queries
Combine operators to filter within a range.Using array operators
Match documents where a field equals any value in an array.Combining filters
Use$and and $or to combine multiple conditions.
Checking field existence
Filter documents based on whether a metadata field exists.Next steps
- API Reference — Filter parameters and options
- Document Metadata — Add metadata during ingestion
- Ranking — Control how results are scored and ordered
- Data Segregation — Strategies for multi-tenant applications