You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a JSON data structure that contains a data object. Inside the data object, there is a code field and a body array. Now, I would like to add the value of the code field to each element of the body array. Specifically, the value of code should be included along with the other fields of each object in the body array. How can I achieve this transformation using the Jolt tool?
I have a JSON data structure that contains a data object. Inside the data object, there is a code field and a body array. Now, I would like to add the value of the code field to each element of the body array. Specifically, the value of code should be included along with the other fields of each object in the body array. How can I achieve this transformation using the Jolt tool?
Here is my input data:
{
"data": {
"code": "Xd001",
"body": [
{
"id": "1",
"name": "ls"
},
{
"id": "2",
"name": "zs"
}
]
}
}
I want the output to look like this:
{
"data": {
"body": [
{
"id": "1",
"name": "ls",
"code": "Xd001"
},
{
"id": "2",
"name": "zs",
"code": "Xd001"
}
]
}
}
The text was updated successfully, but these errors were encountered: