I have multiple JSON objects within items in COSMOS DB. For example:
"Fruit": {
"Apples": 200,
"Oranges": 130,
"Strawberries": {
"Small": 30,
"Large": "Finished"
}
"Fruit": {
"Apples": 78,
"Oranges": 90,
"Strawberries": {
"Small": 10,
"Large": 30
}
And I want to return all fruit where large is "Finished". So in this example just the first object would be returned. I imagine this is straightforward to achieve but I haven’t managed to do this. Any help would be great.
>Solution :
A simple where clause would do,
SELECT *
FROM c
WHERE c.Fruit.Strawberries.Large = "Finished"