Skip to main content

$not

The $not operator negates the boolean value of a single expression.

Input

  • A single expression to evaluate

Output

  • true if the expression evaluates to a falsy value
  • false if the expression evaluates to a truthy value

Examples

Negating True

{
  "$not": [
    true
  ]
}
Result: false

Negating False

{
  "$not": [
    false
  ]
}
Result: true

Negating Expression Result

{
  "$not": [
    {
      "$eq": [
        {
          "$input": "status"
        },
        "active"
      ]
    }
  ]
}
Result: true if the status is NOT “active”, otherwise false