Supported Expressions

The following article describes the supported expressions.

Simple Expression

A simple expression represents a single predicate applied to a single in an object.

Relational Operators

A comparison of a single column to a value included in the query.

columnName comparisonOp value

Example: id eq 1

  • Equal to: eq, =
  • Not equal to: !=, <>, ne
  • Less than: <, lt
  • Less than, or equal to: <=, le
  • Greater than, or equal to: >=, ge
  • Starts with: sw
  • Contains: contains

In Operator

An equality comparison to a comma-separated list of values

columnName in ’(’ value (’,’ value)* ’)’

Example: id in (1, 2, 3, 4)

Is Null/Empty

Check if a single column is (or is not) null or empty. Since javascript has many null-ish values, null, undefined and missing properties are considered equivalent to null. Anything that evaluates as null plus empty strings (''), empty arrays ([]) and objects with no keys ({}) are considered empty.

columnName operator

Example: id is null

Operators: is null, is not null, is empty, is not empty

Values

Supported values are:

  • Integers, e.g. 1234
  • Floats, e.g. 1234.0
  • Single or double-quoted strings with escaping supported in double-quoted strings, e.g. 'abcd', "abcd\"e"
  • Null, i.e. null

Notably, booleans are not supported. Instead, true and false are treated as the integers 0 and 1 respectively.

Column Names

A sequence of ids separated by ’.’. Ids can contain ASCII alphanumeric characters, hyphen (-) and underscore (_), but the first character may not be a number or hyphen.

In the context of typescript, this will be interpreted as a path into a nested object. As in javascript, accessing a missing property in an object will evaluate to undefined. Unlike in javascript, indexing into something other than an object (e.g. undefined) will evaluate to undefined rather than resulting in an error.

Example:

  • a._bc.d-01.e2 applied to { a: { _bc: { 'd-01': { e2: 3 } } evaluates to 3
  • a.missing.d applied to the same object evaluates to undefined.

Compound Expressions

Expressions can be combined with and and or and grouped with parentheses ((/)). These operators are left-associative but parentheses take precedence.

Example: field1 eq 1 and field2 eq 2 or field3 eq 3 and field4 eq 4 is equivalent to ((field1 eq 1 and field2 eq 2) or field3 eq 3) and field4 eq 4

Last updated on