Navigation
This version of the documentation is archived and no longer supported.

$cmp (aggregation)

$cmp

Takes two values in an array and returns an integer. The returned value is:

  • A negative number if the first value is less than the second.
  • A positive number if the first value is greater than the second.
  • 0 if the two values are equal.