I have a JSON :
{
"consultor_do_projeto": [
"Iago de Oliveira",
"Murilo Tavares"
]
}
I need to transform in:
{
"consultor0" : "Iago de Oliveira",
"consultor1" : "Murilo Tavares"
}
In Jolt Spec, Can I do this?
if the third item exists, it will be the consultor2
Thanks to help!
Yes, you can do through use of a Jolt spec such as
[
{
"operation": "shift",
"spec": {
"*_do_projeto": {
"*": {
"@": "&(2,1)&"
}
}
}
}
]
where
and
0,1,..
) of the array.the demo on the site http://jolt-demo.appspot.com/ is