Open olka-fasolka opened 3 years ago
Try this :
[
{
"operation": "shift",
"spec": {
"board": "employees.bosses",
"leaders": {
"*": "employees.bosses"
}
}
}
]
I think this is an appropriate solution for this input,
[
{
"operation": "shift",
"spec": {
"board": {
"*": {
"id": "employees.@(1,id).emp_num",
"role": "employees.@(1,id).position",
"*": "employees.@(1,id).&"
}
},
"leaders": {
"*": {
"id": "employees.@(1,id).emp_num",
"role": "employees.@(1,id).position",
"*": "employees.@(1,id).&"
}
}
}
},
{
"operation": "shift",
"spec": {
"employees": {
"*": {
"@": "employees.bosses"
}
}
}
}
]
I have a problem writing objects to an array. Basically I want to merge the arrays and rename the fields, while keeping the objects seperately.
My input json looks like this:
This is my spec: (I am aware that the values in brackets are probably not right)
and this is my output:
while I expect output that looks like this:
I have major troubles understanding what to do and how the [#n] work, I would really appreciate any help with fixing my spec and explaination why this does/does not work!