$gte (aggregation)
On this page
Definition
-
$gte
-
Compares two values and returns:
true
when the first value is greater than or equivalent to the second value.false
when the first value is less than the second value.
The
$gte
compares both value and type, using the specified BSON comparison order for values of different types.$gte
has the following syntax:For more information on expressions, see Expressions.
Example
Consider an inventory
collection with the following documents:
The following operation uses the $gte
operator to determine if qty
is greater than or equal to 250
:
The operation returns the following results: