Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想通过 JOLT 将 json 中的所有数组转换为键值对列表:
输入:
"ex":{"arr": ["1", "2", "3", "4"]}
所需的输出:
"ex-arr-0": "1", "ex-arr-1": "2", ...
规格
[ { "operation": "shift", "spec": { "ex": { "arr": { "*": "ex-arr-&" } } } } ]
我通过以下方法解决了它:
{ "*": { "ex": {"*": {"*": "&3.&2-&1-&"}} } }