Documentation Center

CEL operators

CEL accepts a set of unary, binary and ternary operators.

Nameand
Typebinary
Data type of operandsBoolean
Data type of expressionBoolean
DescriptionEvaluates to true only if both of its operands are true
Nameor
Typebinary
Data type of operandsBoolean
Data type of expressionBoolean
DescriptionEvaluates to false only if both of its operands are false
Namenot
Typeunary
Data type of operandsBoolean
Data type of expressionBoolean
DescriptionEvaluates to true only if its operand if false
Name? :
Typeternary
Data type of operandsAny (all of the same type)
Data type of expressionWhichever type the operands have
DescriptionEvaluates to the second operand if its first operand is defined, non-null and true; otherwise evaluates to the third operand
Name?:
Typebinary
Data type of operandsAny (all of the same type)
Data type of expressionWhichever type the operands have
DescriptionEvaluates to the first operand if its first operand is defined, non-null and true; otherwise evaluates to the second operand
Name==
Typebinary
Data type of operandsAny (all of the same type)
Data type of expressionBoolean
DescriptionEvaluates to true if its first operand is equal to its second operand
Name!=
Typebinary
Data type of operandsAny (all of the same type)
Data type of expressionBoolean
DescriptionEvaluates to true if its first operand is unequal to its second operand
Namelt
Typebinary
Data type of operandsInteger or float
Data type of expressionBoolean
DescriptionEvaluates to true if its first operand is less than its second operand
Namele
Typebinary
Data type of operandsInteger or float
Data type of expressionBoolean
DescriptionEvaluates to true if its first operand is less than, or equal to, its second operand
Namegt
Typebinary
Data type of operandsInteger or float
Data type of expressionBoolean
DescriptionEvaluates to true if its first operand is greater than its second operand
Namege
Typebinary
Data type of operandsInteger or float
Data type of expressionBoolean
DescriptionEvaluates to true if its first operand is greater than, or equal to, its second operand
Name=~
Typebinary
Data type of operandsString (first operand), regular expression string (second operand)
Data type of expressionBoolean
DescriptionEvaluates to true if its first operand matches its second operand
Name!~
Typebinary
Data type of operandsString (first operand), regular expression string (second operand)
Data type of expressionBoolean
DescriptionEvaluates to true if its first operand does not match its second operand
Name+
Typebinary
Data type of operandsInteger or float
Data type of expressionWhichever type the operands have
DescriptionEvaluates to the sum of its operands
Name+
Typebinary
Data type of operandsString
Data type of expressionString
DescriptionEvaluates to the concatenation of its operands
Name-
Typebinary
Data type of operandsInteger or float
Data type of expressionWhichever type the operands have
DescriptionEvaluates to the difference between its operands
Name*
Typebinary
Data type of operandsInteger or float
Data type of expressionWhichever type the operands have
DescriptionEvaluates to the product of its operands
Name/
Typebinary
Data type of operandsInteger or float
Data type of expressionWhichever type the operands have
DescriptionEvaluates to the division of its operands
Namemod
Typebinary
Data type of operandsInteger or float
Data type of expressionWhichever type the operands have
DescriptionEvaluates to the remainder of the division of its operands
Name-
Typeunary
Data type of operandsInteger or float
Data type of expressionWhichever type the operand has
DescriptionEvaluates to the negative of its operand