JSON JOLT 转换 - 列表列表到第 n 个元素的列表
JSON JOLT transformation - list of list to list of nth elements
我正在尝试为输入编写 JOLT 转换:
{
"time": 1581512850,
"states": [
[
"dewf",
"deswd",
-79.1016,
35.5882
],
[
"dedaswf",
"desfdaeswwd",
-79.5016,
135.8882
]
]
}
预期的 JSON 是:
{
"time": 1581512850,
"states": [
{
"longitude": -79.1016,
"latitude": 35.5882
},
{
"longitude": -79.5016,
"latitude": 65.8882
}
]
}
但我无法更接近解决方案。能请教一下吗?
谢谢!
规格
[
{
"operation": "shift",
"spec": {
"time": "time",
"states": {
"*": {
"2": "states.[&1].longitude",
"3": "states.[&1].latitude"
}
}
}
}
]
我正在尝试为输入编写 JOLT 转换:
{
"time": 1581512850,
"states": [
[
"dewf",
"deswd",
-79.1016,
35.5882
],
[
"dedaswf",
"desfdaeswwd",
-79.5016,
135.8882
]
]
}
预期的 JSON 是:
{
"time": 1581512850,
"states": [
{
"longitude": -79.1016,
"latitude": 35.5882
},
{
"longitude": -79.5016,
"latitude": 65.8882
}
]
}
但我无法更接近解决方案。能请教一下吗?
谢谢!
规格
[
{
"operation": "shift",
"spec": {
"time": "time",
"states": {
"*": {
"2": "states.[&1].longitude",
"3": "states.[&1].latitude"
}
}
}
}
]