Remove entries if empty object or array in Jolt

1.2k views Asked by At

I have the following input JSON:

{
    "Accounts": [
        {
            "Reference": {
                "Key": "1111",
                "System": "Oracle"
            },
            "ContactMethods": {
                "Phone": [{...}, {...}, ...],
                "Email": [{...}, {...}, ...],
                "Address": [], // remove this
                "Website": [] // remove this
            },
            "Registration" : {...}
        },
        {
            "Reference": {
                "Key": "2222",
                "System": "DB2"
            },
            "ContactMethods": {
                "Phone": [{...}, {...}, ...],
                "Email": [], // remove this
                "Address": [], // remove this
                "Website": [{...}, {...}, ...]
            },
            "Registration" : {} // or null, remove this
        },
    ]
}

How do I remove the entries that are either empty object, empty array or null?

1

There are 1 answers

0
Milo S On BEST ANSWER

Jolt does not support "conditional" removals.