如果Jolt中有空对象或数组,则删除条目

时间:2017-08-30 06:56:35

标签: json jolt

我有以下输入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
        },
    ]
}

如何删除空对象,空数组或空的条目?

1 个答案:

答案 0 :(得分:1)

Jolt不支持“有条件”删除。