Skip to main content
Use metadata filters to narrow search results to chunks matching specific criteria. Reducing the search space improves relevance and performance. For multi-tenant applications, see Data Segregation.

Filter operators

Basic filtering

Pass a filter 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.
Exclude documents matching 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