Comparison operators can be used in conjunction with Boolean operators to construct the expressions that we need to evaluate as true/false for the output of our pipeline's stage.
The most commonly used operators are listed here:
- $eq ( equal )
- $ne ( not equal)
- $gt (greater than)
- $gte (greater than or equal)
- $lt
- $lte
All the aforementioned mentioned operators return a Boolean value of true or false.
The only operator not returning a Boolean value is $cmp, which returns 0 if the two arguments are equivalent, 1 if the first value is greater than the second, and -1 if the second value is greater than the first.