Reputation: 31
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", ...
Upvotes: 0
Views: 1157
Reputation: 31
i solved it via the following:
{
"*":
{
"ex": {"*": {"*": "&3.&2-&1-&"}}
}
}
Upvotes: 0
Reputation: 4586
Spec
[
{
"operation": "shift",
"spec": {
"ex": {
"arr": {
"*": "ex-arr-&"
}
}
}
}
]
Upvotes: 1