如果 Jolt 中的对象或数组为空,则删除条目
Remove entries if empty object or array in 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
},
]
}
如何删除空对象、空数组或 null 的条目?
Jolt 不支持 "conditional" 删除。
我有以下输入 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 的条目?
Jolt 不支持 "conditional" 删除。