Compares two values and returns:
-1if the first value is less than the second.
1if the first value is greater than the second.
0if the two values are equivalent.
$cmphas the following syntax:
For more information on expressions, see Expressions.
inventory collection with the following documents:
The following operation uses the
$cmp operator to compare the
qty value with
The operation returns the following results: