I have something similar to the following json structure and I need to search for an specific filename in the Azure CosmosDB data explorer (no matter the position), I have been trying differents ways and also using CROSS APPLY FLATTEN but i cannot get it
{
"entityId": "f07256a5-0e60-412a-bcc9-2e1aa66b69f5",
"array1": [
{
"array2": [
{
"fileName": "filename1.pdf",
},
{
"fileName": "filename2.pdf",
}
]
}
]
}
Any ideas? thanks
2
Answers
This one works for me:
It uses self-joins to create an object for each filename and then filters from those which has the right filename.
You need something like below,