JSON Format
Basic Structure
A single filter is constructed as an object with a single key in it: Metadata filter:$and and $or:
Operators
Scalar Comparison Operators
Set Operators
These operators check if a metadata value is in (or not in) a provided list. The list must contain values of the same type.$in and $nin require arrays of the same type (all strings, all ints, all floats, or all booleans).
Metadata Array Operators
These operators check if an array metadata field contains (or does not contain) a specific scalar value. The metadata field must be an array type (string[], int[], float[], or boolean[]).Important:
$contains and $not_contains have different meanings depending on context:- On metadata fields (e.g.,
{"tags": {"$contains": "tech"}}): Checks if the array metadata field contains the value - On
#document(e.g.,{"#document": {"$contains": "text"}}): Checks if the document text contains the substring
Document Operators
Logical Operators
Rules
-
Shorthand equality: Direct value assignment is equivalent to
$eq:is equivalent to: -
Single field per object: Each filter object can contain only one field or one logical operator (
$and/$or). - Single operator per field: For field dictionaries, only one operator is allowed per field.