WHERE & HAVING

Structure

The where and having clauses use the following format:

WHERE: = [ CONDITION | ('AND'|'OR') | WHERE ],
CONDITION: = {field, op, val} | {field, op, subqry}
//...
where: [
    { field: f.select('name'), op: '=', val: 'acme' },
    { field: f.select('annualRevenue'), op: '>=', val: 100 }
]
where: [
    { field: f.select('name'), op: '=', val: 'acme' },
    'OR',
    { field: f.select('annualRevenue'), op: '>=', val: 100 }
]
circle-info
  • putting AND between conditions is optional. If left out, it will be implied (but may be included for readability)

  • If op is omitted, it defaults to either = orIN depending on the val type

  • nothing prevents multiple LogicalConditions (AND|OR) from occurring back to back. If this happens, the last condition will be used

Nesting Conditions

Conditions can be grouped/nested in parentheses by starting a new array

Value Rendering

Condition values are automatically converted based on their type:

string

string[]

number

boolean

Date

Last updated

Was this helpful?