I have two JSON objects as input and want to add a value of one object to the other. I have tried many different specs, but I can't get it to work.
Here is an example of the situation:
Input:
{
"all": {
"a": "1",
"b": "2",
"c": "3"
},
"partially": {
"d": "4",
"e": "5",
"f": "6"
}
}
I want to have all data from the "all" object and I do not know what keys will be present. On the other hand I know the keys of the "partially" object and I want to shift only selected. So for example here is a desired output:
{
"result" : {
"a" : "1",
"b" : "2",
"c" : "3",
"d" : "4"
}
}
This is my current spec, but it produces an array with separate data and does not select only "d" from the "partially". If I try to select only "d" it shifts the value but not the key, but I need both:
[
{
"operation": "shift",
"spec": {
"all": "result",
"partially": "result"
}
}
]
Is there any way to do this? Thank you!