如何将生成的JSON作为单独的对象/记录(如输入)而不是作为一个对象?

时间:2019-03-27 14:54:00

标签: json jolt

我刚开始使用JOLT

我有此输入JSON

[
  {
    "agent-submit-time": -1,
    "agent-end-time": 123445,
    "agent-name": "Marie Bayer-Smith"
  },
  {
    "agent-submit-time": -1,
    "agent-end-time": 123445,
    "agent-name": "Marie Bayer-Smith"
  }
]

这是我拥有的JOLT规范

[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "*-*-*": "&(0,1)_&(0,2)_&(0,3)",
        "*-*": "&(0,1)_&(0,2)",
        "*": "[&]"
      }
    }
  }
]

它给了我输出

{
  "agent_submit-time" : [ -1, -1 ],
  "agent_end-time" : [ 123445, 123445 ],
  "agent_name" : [ "Marie Bayer-Smith", "Marie Bayer-Smith" ]
}

但我想要

[
{
  "agent_submit_time" : -1,
  "agent_end_time" : 123445,
  "agent_name" : "Marie Bayer-Smith"
},
{
  "agent_submit_time" : -1,
  "agent_end_time" : 123445,
  "agent_name" : "Marie Bayer-Smith"
}
]

任何人都可以解释规范有什么问题以及如何解决吗? 谢谢

0 个答案:

没有答案