2.2.3.6.1.1.2 Operator Precedence
The following table summarizes the precedence of operators in the common expression syntax. Operators are listed by operator category in order of precedence from highest to lowest. Operators in the same category have equal precedence.
Category |
Expression |
Common Expression |
---|---|---|
Grouping |
(x) |
parenExpression, boolParenExpression |
Primary |
x/m |
memberExpression |
Primary |
x(…) |
methodCallExpression, boolMethodCallExpression |
Unary |
-x |
negateExpression |
Unary |
not x |
notExpression |
Unary |
cast(T), cast(x, T) |
castExpression |
Multiplicative |
x mul y |
mulExpression |
Multiplicative |
x div y |
divExpression |
Multiplicative |
x mod y |
modExpression |
Additive |
x add y |
addExpression |
Additive |
x sub y |
subExpression |
Relational and type testing |
x lt y |
ltExpression |
Relational and type testing |
x gt y |
gtExpression |
Relational and type testing |
x le y |
leExpression |
Relational and type testing |
x ge y |
geExpression |
Relational and type testing |
isof(T), isof(x, T) |
isofExpression |
Equality |
x eq y |
eqExpression |
Equality |
x ne y |
neExpression |
Conditional AND |
x and y |
andExpression |
Conditional OR |
x or y |
orExpression |
Table: Operator Precedence for Query Option Expressions
A data service MAY<49> support some or all of the common expressions that represent the operators above. For supported operators, the data service SHOULD evaluate the operators in a common expression in order of precedence of operator category.