Skip to main content

$ne

The $ne operator checks if two values are not equal.

Input

  • An array containing exactly two values to compare

Output

  • true if the two values are not equal
  • false if the two values are equal

Examples

Basic Inequality

Result: true

Equality (Returns False)

Result: false

Comparing Field Values

Result: true if the status field is not “inactive”, otherwise false

Number Comparison

Result: true if the count field is not equal to 0, otherwise false