Where Filter
Filter Conditions (where, orWhere, whereNot, etc.)¶
Description: API endpoints support advanced filtering through structured condition arrays. These filters allow precise control over which records are included in the response.
Supported Filter Keys¶
| Filter Key | Format | Description |
|---|---|---|
where |
[[field, operator, value], ...] |
Simple comparisons using operators like ==, >, <, etc. |
orWhere |
[[field, operator, value], ...] |
OR comparison group; at least one condition must match |
whereNot |
[[field, value], ...] |
Negated equality comparisons (!=) |
whereIn |
[[field, [value1, value2, ...]], ...] |
Field must match one of the values in the list |
whereNotIn |
[[field, [value1, value2, ...]], ...] |
Field must not match any of the values in the list |
whereBetween |
[[field, [min, max]], ...] |
Field value must be within the range [min, max] |
whereNotBetween |
[[field, [min, max]], ...] |
Field value must be outside the range [min, max] |
Combining conditions¶
All conditions in where, whereNot, whereIn, whereNotIn, whereBetween, and whereNotBetween are combined with AND.
Conditions inside orWhere are grouped with parentheses and combined with OR. The complete expression is evaluated as:
all standard filters AND (orWhere[0] OR orWhere[1] OR ...)
For example:
{
"where": [
["enable", "==", 1]
],
"orWhere": [
["name", "like", "john"],
["email", "like", "john"]
]
}
is equivalent to:
enable = 1 AND (name contains "john" OR email contains "john")
If orWhere is used without other filters, at least one of its conditions must match. An empty or omitted orWhere does not change the result.
Operators Supported in where and orWhere¶
"=="or"=": Equal to"!=": Not equal to">"/"<"/">="/"<=": Numeric comparisons"like": Case-insensitive substring match.%characters are optional and are removed before matching
The exact fields and operators available depend on the endpoint. orWhere accepts the same fields, operators, and value types as where for that endpoint.
Example Usage¶
{
"where": [
["login", ">", 1000],
["enable", "==", 1]
],
"orWhere": [
["name", "like", "John"],
["email", "like", "John"]
],
"whereNot": [
["group", "admin"]
],
"whereIn": [
["status", ["active", "pending"]]
],
"whereBetween": [
["balance", [1000, 5000]]
]
}
This example requires all standard filters to match and additionally requires either name or email to contain John.
Access-control and manager-scope restrictions are applied independently from request filters and cannot be bypassed through orWhere.