Skip to main content

$isNull

The $isNull operator checks if a value is null.

Input

  • A single value of any type

Output

  • true if the input value is null, false otherwise

Examples

Check Null Value

{
  "$isNull": [
    null
  ]
}
Result: true

Check Non-Null Value

{
  "$isNull": [
    "hello"
  ]
}
Result: false

From Field

{
  "$isNull": [
    {
      "$input": "optional_field"
    }
  ]
}
Result: true if the optional_field is null, otherwise false