Skip to content

ScaleTrade TCP API - Table Filters

Table filter syntax

Filtered table and export methods use the same top-level filter fields.

Field Format Meaning
where [[field, operator, value], ...] Every comparison must match
orWhere [[field, operator, value], ...] At least one comparison must match
whereNot [[field, value], ...] Every field must differ from the value
whereIn [[field, [values...]], ...] Field must match one listed value
whereNotIn [[field, [values...]], ...] Field must not match any listed value
whereBetween [[field, [from, to]], ...] Field must be inside the inclusive range
whereNotBetween [[field, [from, to]], ...] Field must be outside the inclusive range

All standard filters are combined with AND. Conditions inside orWhere are grouped with parentheses and combined with OR:

all standard filters AND (orWhere[0] OR orWhere[1] OR ...)

For example:

{
  "where": [
    ["enable", "==", 1]
  ],
  "orWhere": [
    ["name", "like", "john"],
    ["email", "like", "john"]
  ]
}

is evaluated as:

enable = 1 AND (name LIKE "john" OR email LIKE "john")

When orWhere is present without other filters, at least one of its conditions must match. An empty or omitted orWhere does not affect the result.

Supported fields and operators depend on the method. orWhere uses the same fields, value types, and comparison operators as where for that method. Access-control constraints are applied independently and cannot be bypassed with orWhere.

The same semantics are used for in-memory lists, database-backed lists, and exports.