Overview
Parameters
How to use operators and arrays in our API
This guide explains how to use query parameters in our API.
Operators
Fields can be filtered using operators, on the documentation you'll see a (operator)
suffix indicating that the field can be used as an operator.
When using a list of values, separate values with a semicolon ;
.
Numerical operators
Operator | Description | Example |
---|---|---|
Default operator, equivalent to eq | score=1 | |
eq | Equals exactly | score=eq:1 |
neq | Not equals | score=neq:1 |
gt | Greater than | score=gt:1 |
gte | Greater than or equal | score=gte:1 |
lt | Less than | score=lt:1 |
lte | Less than or equal | score=lte:1 |
in | In a list of values. | score=in:1;2;3 |
nin | Not in a list of values. | score=nin:1;2;3 |
between | Between two values. | score=between:1;2 |
Boolean operators
Valid values are true
and false
.
Operator | Description | Example |
---|---|---|
Default operator, equivalent to eq | is_active=true | |
eq | Equals exactly | is_active=eq:true |
neq | Not equals | is_active=neq:true |
String operators
Operator | Description | Example |
---|---|---|
Default operator, equivalent to ilike | name=John | |
eq | Equals exactly | name=eq:John |
neq | Not equals | name=neq:John |
like | Contains | name=like:John |
nlike | Does not contain | name=nlike:John |
ilike | Contains (ignore case) | name=ilike:John |
nilike | Does not contain (ignore case) | name=nilike:John |
in | In a list of values. | name=in:John;Doe |
nin | Not in a list of values. | name=nin:John;Doe |
starts | Starts with | name=starts:John |
ends | Ends with | name=ends:John |
Date operators
When using dates, time are not taken into account. Meaning that eq:2022-01-01
will match all documents of that date.
Operator | Description | Example |
---|---|---|
Default operator, equivalent to eq | date=2022-01-01 | |
eq | Equals exactly | date=eq:2022-01-01 |
neq | Not equals | date=neq:2022-01-01 |
gt | Greater than | date=gt:2022-01-01 |
gte | Greater than or equal | date=gte:2022-01-01 |
lt | Less than | date=lt:2022-01-01 |
lte | Less than or equal | date=lte:2022-01-01 |
between | Between two values. | date=between:2022-01-01;2022-01-02 |
Arrays
When you need to pass multiple values for the same parameter, repeat the parameter name for each value.
Example: field=value1&field=value2