Hi,
I need to convert via N1QL an array that is part of a document into an object.
Example, I have that:
{
“myobj”: [
{
“1”: {
“field1”: true,
“field2”: 0
}
},
{
“34”: {
“field1”: false,
“field2”: 1000
}
},
{
“10”: {
“field1”: true,
“field2”: 21
}
}
]
}
and the final document I need is like that one:
{
“myobj”: {
“1”: {
“field1”: true,
“field2”: 0
},
“34”: {
“field1”: false,
“field2”: 1000
},
“10”: {
“field1”: true,
“field2”: 21
}
}
}
I have tried to use object_concat with each position of the original array, but id does not work and I am unable to find the correct syntax to get the final outcome I need.
Could any of you help me with thtat?
Thanks!