摇晃变换 - json 的取消嵌套问题
jolt transformation - unnesting problem with json
我正在尝试为这种json:
做颠簸改造
{
"id" : "6aa0734f-6d6a-4b95-8a2b-2dde346f9df7",
"ts" : 1583684304500000,
"measurements" : {
"A4" : {
"value" : 164341584
},
"A5" : {
"value" : -20486832
}
}}
最后我需要得到这样的东西:
{"id" : "6aa0734f-6d6a-4b95-8a2b-2dde346f9df7",
"ts" : 1583684304500000,
"A4" : 164341584,
"A5" : -20486832
}
我需要使用那种规范?
非常感谢!
震动规格:
[
{
"operation": "shift",
"spec": {
"ts": "ts",
"id": "id",
"measurements": {
"*": {
"*": {
"@": "&2"
}
}
}
}
}
]
输入:
{
"id": "6aa0734f-6d6a-4b95-8a2b-2dde346f9df7",
"ts": 1583684304500000,
"measurements": {
"A4": {
"value": 164341584
},
"A5": {
"value": -20486832
}
}
}
输出:
{
"ts" : 1583684304500000,
"id" : "6aa0734f-6d6a-4b95-8a2b-2dde346f9df7",
"A4" : 164341584,
"A5" : -20486832
}
适用于任意数量的 A。在这里试试:https://jolt-demo.appspot.com/#inception
我正在尝试为这种json:
做颠簸改造{
"id" : "6aa0734f-6d6a-4b95-8a2b-2dde346f9df7",
"ts" : 1583684304500000,
"measurements" : {
"A4" : {
"value" : 164341584
},
"A5" : {
"value" : -20486832
}
}}
最后我需要得到这样的东西:
{"id" : "6aa0734f-6d6a-4b95-8a2b-2dde346f9df7",
"ts" : 1583684304500000,
"A4" : 164341584,
"A5" : -20486832
}
我需要使用那种规范?
非常感谢!
震动规格:
[
{
"operation": "shift",
"spec": {
"ts": "ts",
"id": "id",
"measurements": {
"*": {
"*": {
"@": "&2"
}
}
}
}
}
]
输入:
{
"id": "6aa0734f-6d6a-4b95-8a2b-2dde346f9df7",
"ts": 1583684304500000,
"measurements": {
"A4": {
"value": 164341584
},
"A5": {
"value": -20486832
}
}
}
输出:
{
"ts" : 1583684304500000,
"id" : "6aa0734f-6d6a-4b95-8a2b-2dde346f9df7",
"A4" : 164341584,
"A5" : -20486832
}
适用于任意数量的 A。在这里试试:https://jolt-demo.appspot.com/#inception