Skip to main content

$null

The $null operator returns the null value.

Input

  • No parameters required

Output

  • The null value

Examples

Basic Usage

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

Using in Conditional

{
  "$ifelse": [
    {
      "$eq": [
        {
          "$input": "status"
        },
        "pending"
      ]
    },
    {
      "$input": "result"
    },
    {
      "$null": []
    }
  ]
}
Result: The result field if status is “pending”, otherwise null