0
votes

I would like to convert ALL arrays in a json via JOLT to a list of key-value pairs:

input:

"ex":{"arr": ["1", "2", "3", "4"]}

desired output:

"ex-arr-0": "1", 
"ex-arr-1": "2", ...
2

2 Answers

1
votes

Spec

[
  {
    "operation": "shift",
    "spec": {
      "ex": {
        "arr": {
          "*": "ex-arr-&"
        }
      }
    }
  }
]
0
votes

i solved it via the following:

{
    "*": 
    {
        "ex": {"*": {"*": "&3.&2-&1-&"}}
    }
}