I am trying to transform the data from a multi array to single array using jolt technique. But unable to do so. Below are the details.
Input file:
{
"oi": [
{
"ei": [
{
"type": "bs",
"id": "797416713"
}
]
},
{
"ei": [
{
"type": "bs",
"id": "797416716"
}
]
}
]
}
Jolt file used is as below:
[
{
"operation": "shift",
"spec": {
"oi": {
"*": {
"ei": {
"*": {
"type": {
"bs": {
"@(2,id)": "oi[#3].bs"
}
}
}
}
}
}
}
}
]
Expected output from above is as below.
{
"oi": [
{
"bs": [
"797416713",
"797416716"
]
}
]
}
Actual output coming from jolt is :
{
"oi": [
{
"bs": [
"797416713",
"797416716"
]
}
]
}