Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In Jolt, null values can be eliminated using the "remove" transform. The remove transform takes a list of keys as inputs and removes them from the input JSON, including any nested values that may be associated with them. To remove all null values from the input JSON, you can use the "remove" transform with a list of keys that correspond to the null values in your input data. For example, the following Jolt specification removes all null values from the input JSON:

[
  {
    "operation": "remove",
    "spec": {
      "*": null
    }
  }
]

This specification uses the "" wildcard key to match all keys in the input JSON, and removes any associated null values. Note that this specification will remove all null values in the input JSON, including null values in nested objects and arrays. If you want to only remove null values from specific keys, you can provide a list of keys in the "spec" field instead of using the "" wildcard key.