【发布时间】:2021-03-16 14:30:03
【问题描述】:
我的Json输入如下
{
"ref": "22",
"id": "177",
"table": [
{
"zn": 1,
"stfflbisart": 10
},
{
"zn": 2,
"stfflbisart": 50
}
]
}
我希望 ref 字段包含在数组对象中存在的每个元素中
我想要的输出如下:
{
"id": "177",
"table": [
{
"zn": 1,
"stfflbisart": 10,
"ref": "22"
},
{
"zn": 2,
"stfflbisart": 50,
"ref": "22"
}
]
}
我尝试的 Jolt 规范没有奏效。
[
{
"operation": "shift",
"spec": {
"ref": "ref",
"table": {
"*": {
// simple match. Put the value '4' in the output under the "Rating" field
"*": "[&1].&"
}
}
}
}
]
这里非常感谢任何帮助。
【问题讨论】:
标签: json transformation jolt