Skip to main content

$gte

The $gte operator checks if the first value is greater than or equal to the second value.

Input

  • An array containing exactly two values to compare

Output

  • true if the first value is greater than or equal to the second value
  • false otherwise (including when either value is null)

Examples

Greater Than

{
  "$gte": [
    10,
    5
  ]
}
Result: true

Equal Values

{
  "$gte": [
    5,
    5
  ]
}
Result: true

Less Than (Returns False)

{
  "$gte": [
    3,
    7
  ]
}
Result: false

Field Value Comparison

{
  "$gte": [
    {
      "$input": "score"
    },
    60
  ]
}
Result: true if the score field is greater than or equal to 60, otherwise false