{
"name": "XYZ",
"lastName": "PQR",
"address": "abc, mnop, 534291"
}
{
"employee": {
"name": "XYZ",
"lastName": "PQR",
"address": "abc, mnop, 534291"
},
"address": {
"name": "XYZ",
"lastName": "PQR",
"address": "abc, mnop, 534291"
}
}
You can use *
and @
wildcards together within a shift transformation like this :
[
{
"operation": "shift",
"spec": {
"*": "address.&", // this needs an ampersand to replicate the whole content
"@": "employee" // while this one doesn't
}
}
]
the demo on the site http://jolt-demo.appspot.com/ is :
or another alternative option might be :
[
{
"operation": "shift",
"spec": {
"@": ["employee", "address"]
}
}
]
the demo is :