- Reference >
- Operators >
- Aggregation Pipeline Operators >
- Comparison Aggregation Operators >
- $gt (aggregation)
$gt (aggregation)¶
On this page
Definition¶
-
$gt¶ Compares two values and returns:
truewhen the first value is greater than the second value.falsewhen the first value is less than or equivalent to the second value.
The
$gtcompares both value and type, using the specified BSON comparison order for values of different types.$gthas the following syntax:For more information on expressions, see Expressions.