Newer Version Available
Comparison Operators
Use comparison operators to compare values.
Comparisons are defined for values of the same type only. For example, strings can be compared with strings and numbers compared with numbers.
| Operator | Name | Description |
|---|---|---|
| == | Equals | True if the operands are equal. String comparisons that use the equals operator are case-sensitive. |
| != | Not equals | True if the operands aren’t equal. |
| < | Less than | True if the left operand is less than the right operand. |
| <= | Less or equal | True if the left operand is less than or equal to the right operand. |
| > | Greater than | True if the left operand is greater than the right operand. |
| >= | Greater or equal | True if the left operand is greater than or equal to the right operand. |
| matches | Matches |
True if the left operand contains the string on
the right. Wildcards and regular expressions aren’t supported. This operator is not
case-sensitive. For example, the following query matches airport codes such as LAX, LAS,
ALA, and BLA:
|
| in | In | If the left operand is a dimension, true if the
left operand has one or more of the values in the array on the right. For
example:If the array is empty, everything is filtered and the results are empty. Ranges that are out of order (for example, in ["20 years ago" .. "2016-01-11"] or in ["Z" .. "A"] ), evaluate to false. |
| not in | Not in |
True if the left operand isn’t equal to any of
the values in an array on the right. The results include rows for which the origin key
doesn’t exist. For example:
|
Example
Given a row for a flight with the origin “SFO” and the destination “LAX” and weather of
“rain” and “snow,” here are the results for each type of "in" operator:
weather in ["rain", "wind"] = true
weather not in ["rain", "wind"] = false