Overview
Each dataset can declare ametadata_schema — a list of fields available for filtering. Use list_datasets() to see what’s filterable:
Filter Syntax
Filters map each dataset ID to a filter object. Datasets without an entry are queried unfiltered.Operators
Comparison
| Operator | Description | Example |
|---|---|---|
$eq | Equals | {"status": {"$eq": "published"}} |
$ne | Not equals | {"status": {"$ne": "draft"}} |
$gt | Greater than | {"score": {"$gt": 0.5}} |
$gte | Greater or equal | {"year": {"$gte": 2020}} |
$lt | Less than | {"price": {"$lt": 100}} |
$lte | Less or equal | {"year": {"$lte": 2024}} |
$in | In array | {"status": {"$in": ["published", "reviewed"]}} |
Logical
| Operator | Description | Example |
|---|---|---|
$and | All conditions must match | {"$and": [{...}, {...}]} |
$or | Any condition must match | {"$or": [{...}, {...}]} |
Rules
- Each field has exactly one operator:
{"field": {"$op": value}} - Top-level fields are implicitly ANDed
- Max nesting depth: 3 levels
- Max conditions: 20 per dataset
- Field names must not start with
_or$
Examples
Simple filter
Multiple fields (implicit AND)
Explicit AND
OR
Cross-dataset (different filters per dataset)
Schema Field Types
| Type | Description | Filter operators |
|---|---|---|
string | Text value | $eq, $ne, $in |
number | Numeric value | All comparison + $in |
boolean | True/false | $eq, $ne |
string[] | Array of strings | $in |