0

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", ...
Daniel
  • 31
  • 7

2 Answers2

1

Spec

[
  {
    "operation": "shift",
    "spec": {
      "ex": {
        "arr": {
          "*": "ex-arr-&"
        }
      }
    }
  }
]
Milo S
  • 4,466
  • 1
  • 19
  • 22
0

i solved it via the following:

{
    "*": 
    {
        "ex": {"*": {"*": "&3.&2-&1-&"}}
    }
}
Daniel
  • 31
  • 7