The JWT expression parser accepts the most common comparison operators as well as logical operators .
The main purpose of these operators is to construct complex logical comparisons by linking individual expressions.
The operators, their meaning and the applicable data types you can use them with are listed below. A comparison always returns a BOOLEAN value. The table below lists all logical operators that can be used for linking logical terms in an expression. Logical operators take logical terms (which return BOOLEAN values) as operands and can thus be built using: Logical operators can only be used in logical expressions in the Logical mode or in combination with the conditional operator. The conditional operator It basically allows you to construct the following expression: IF logical_expression The conditional operator is extremely helpful when being used in calculated fields.Comparison operators
Logical operators
Conditional operator
?
:
is a powerful operator to construct conditional expressions.true
THEN term_1 ELSE term_2.<logical_expression> ? <term_1> : <term_2>
List operators
Function | Short description | Output |
---|---|---|
APPEND | Combines the elements of two lists. | LIST |
UNION | Returns distinct elements of two lists. | LIST |
INTERSECT | Returns common elements of two lists. | LIST |
EXCEPT | Removes certain elements from a list. | LIST |
Order of operations
If you use multiple operators in a single expression, they will follow a certain order in which they are processed or a precedence.
OPERATORS | PRECEDENCE | ASSOCIATIVITY |
---|---|---|
INTERSECT | 1 (highest) | Left-to-right |
APPEND, EXCEPT, UNION | 2 (lowest) | Left-to-right |
- When using the list operators, you have to make sure that both lists that you compare are of the same type.
- All operators are case insensitive, i.e., they can also be written in lower case:
append
,union
,intersect
andexcept
. - There are four equivalent functions available for each type of list, and their behavior is exactly equivalent to that of its corresponding operator.
- This way, you can choose to use operators or functions according to your preference. Although operators yield shorter expressions and with fewer parentheses, the usage of functions produces a more functional consistent syntax.
If you still have questions, feel free to refer to our support team.