I have the following cosmosdb document:
{
id: "id",
outer: [
{
"inner": [ "a", "b", "c" ]
},
{
"inner": [ "d", "e", "f" ]
}
]
}
And I need to create a SQL request which would return all of the combined values of the "inner" arrays, like this:
{
"allInners": [ "a", "b", "c", "d", "e", "f" ]
}
I was able to unwind the first array level using the "IN" operator, but I am not sure how unwind it one more level and to handle double or even triple nested arrays. The following is my subquery to aggregate those items
SELECT
... other stuff.
ARRAY(SELECT VALUE innerObj.inner FROM innerObj IN c.outer) AS allInners,
...
FROM c
