Skip to main content

$isEmpty

The $isEmpty operator checks if a value is empty (null, empty string, or empty collection).

Input

  • A single value of any type

Output

  • true if the input value is empty (null, empty string, or empty collection), false otherwise

Examples

Check Empty String

{
  "$isEmpty": [
    ""
  ]
}
Result: true

Check Empty Array

{
  "$isEmpty": [
    []
  ]
}
Result: true

Check Empty Object

{
  "$isEmpty": [
    {}
  ]
}
Result: true

Check Non-Empty Value

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

From Field

{
  "$isEmpty": [
    {
      "$input": "text_field"
    }
  ]
}
Result: true if the text_field is empty, otherwise false