Skip to main content

$gt

The $gt operator checks if the first value is greater than the second value.

Input

  • An array containing exactly two values to compare

Output

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

Examples

Basic Comparison

Result: true

False Comparison

Result: false

Field Value Comparison

Result: true if the age field is greater than 18, otherwise false

String Comparison

Result: true (lexicographic comparison)