AQL Cheatsheet - Operators
Text Operators
Description
A text value, represented as a string of characters. The "text" type can include any characters, including letters, numbers, symbols, and whitespace.
Tags
Operator, Condition
Operators
==
; is
Equal to
products.name == 'Dandelion'
products.name is 'Dandelion'
!=
; is not
Not equal to
products.name != 'Rock'
products.name is not 'Rock'
like
Match the pattern specified
products.name like '%Dan'
not like
Not match the pattern specified
products.name not like '%Dan'
ilike
Match the pattern specified, case insensitive
products.name ilike '%dan'
not ilike
Match the pattern specified, case insensitive
products.name not ilike '%dan'
is null
Include if the value is null
products.name is null
is not null
Include if the value is not null
products.name is not null
Learn more
List Operators
Description
Check if the field value is in the list.
Tags
Operator, Condition
Operators
in
Include if the value is in the list
products.name in ['Dandelion', 'Rock']
not in
Include if the value is not in the list
products.name not in ['Dandelion', 'Rock']
Learn more
Truefalse Operators
Description
A boolean value, represented as either "true" or "false". This is commonly used to represent logical values. For example, it can be used to represent the result of a comparison, the status of a switch, or the answer to a yes/no question.
Tags
Operator, Condition
Operators
is
Equal to
orders.is_paid is true
is not
Not equal to
orders.is_paid is not true
is null
Include if null
orders.is_paid is null
is not null
Include if not null
orders.is_paid is not null
Learn more
Number Operators
Description
A numeric value, represented as an numeric, integer, float, or double. It can be used as dimension or measure type. The number type can include positive and negative values, as well as decimal points.
Tags
Operator, Condition
Operators
==
; is
Equal to
order_items.discount == 0.5
order_items.discount is 0.5
!=
; is not
Not equal to
order_items.discount != 1
order_items.discount is not 1
>
Greater than
order_items.discount > 0.5
>=
Greater than or equal to
order_items.discount >= 0.5
<
Less than
order_items.discount < 0.5
<=
Less than or equal to
order_items.discount <= 0.5
is null
Include if null
order_items.discount is null
is not null
Include if not null
order_items.discount is not null
+
Add two numeric values
products.cost + products.profit
-
Subtract two numeric values
products.revenue - products.cost
*
Multiply two numeric values
orders.quantity * products.price
/
Divide two numeric values
products.profit / products.cost
Learn more
Datetime Operators
Description
Right hand side of datetime operator takes a datetime scalar type as input and always starts with @ token. Datetimes can be expressed in a fully supported format as @YYYY-MM-DD HH:MM:SS, in shorter variations like @YYYY-MM, or a relative datetime (relative to the current real world time) like @(last 7 days).
Tags
Operator, Condition
Operators
==
Include data that equal to an absolute timestamp
orders.created_at == @2022
orders.created_at == @(last 7 days)
is
; match
; matches
Include data that are in a time period
orders.created_at is @2022
orders.created_at match @(last 7 days)
!=
Include data that do not equal to an absolute timestamp
orders.created_at != @2022-01
is not
Include data that are not in a time period
orders.created_at is not @2022-01
<
Include data that are before a specific time period
orders.created_at < @2022
<=
Include data that are before or in a specific time period
orders.created_at <= @2022
>
Include data that are after a specific time period
orders.created_at > @(yesterday)
>=
Include data that are after or in a specific time period
orders.created_at >= @(yesterday)
is null
Include if the value is null
orders.created_at is null
is not null
Include if the value is not null
orders.created_at is not null
+
Add an interval to a datetime
orders.created_at + interval(3 months)
orders.created_at + interval(-1 month)
-
Subtract an interval to a datetime
orders.created_at - interval(3 months)
orders.created_at - interval(-1 month)