I'm attempting to transform a document like this:
{
"first_name": "John",
"last_name": "Doe",
"children": [{ "first_name": "Jack" }, { "first_name": "Jane" }]
}
Into something like this:
[
{
"first_name": "Jack",
"last_name": "Doe"
},
{
"first_name": "Jane",
"last_name": "Doe"
}
]
This would take the children's first names and combine them with the parent's last name. I'm not sure if this can be done currently without some way of escaping the context created by using over, like this (borrowing from syntax I've seen in JSONata):
{
"operation": "shift",
"spec": {
"first_name": "first_name",
"last_name": "$$.last_name"
},
"over": "children"
}
This would be a nice feature to have, unless some other solution is possible.
I'm attempting to transform a document like this:
{ "first_name": "John", "last_name": "Doe", "children": [{ "first_name": "Jack" }, { "first_name": "Jane" }] }Into something like this:
[ { "first_name": "Jack", "last_name": "Doe" }, { "first_name": "Jane", "last_name": "Doe" } ]This would take the children's first names and combine them with the parent's last name. I'm not sure if this can be done currently without some way of escaping the context created by using
over, like this (borrowing from syntax I've seen in JSONata):{ "operation": "shift", "spec": { "first_name": "first_name", "last_name": "$$.last_name" }, "over": "children" }This would be a nice feature to have, unless some other solution is possible.