【问题标题】:Remove entries if empty object or array in Jolt如果 Jolt 中的对象或数组为空,则删除条目
【发布时间】:2017-08-30 06:56:35
【问题描述】:

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

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

【问题讨论】:

    标签: json jolt


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-28
      • 1970-01-01
      • 2022-11-14
      • 2013-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-03
      相关资源
      最近更新 更多