Comparison#
CEL provides operators for comparing values.
Equality#
The == operator tests equality.
The != operator tests inequality.
See the specific semantics when comparing lists, maps, null, and Protocol Buffer messages.
Ordering#
The <, <=, >, and >= operators compare values with a natural order.
These operators work on integers, unsigned integers, doubles, strings, bytes, booleans, timestamps, and durations.
Bytes and strings compare lexicographically.
Booleans order false before true.
Mixed types#
Comparisons require matching types.
Use explicit conversion to match types.
See also#
- Booleans and numbers - Numeric types
- Strings - String comparisons