This document has an example query to run against a Cosmos DB SQL API
https://learn.microsoft.com/en-us/azure/cosmos-db/tutorial-query-sql-api#example-query-2
SELECT c.givenName
FROM Families f
JOIN c IN f.children
WHERE f.id = 'WakefieldFamily'
ORDER BY f.children.grade ASC
Using https://www.documentdb.com/sql/demo
I couldn't get a similar example to work until I put a [0] into the order by. I just got {}. NB I know the URL says documentdb but the page header on that page says Cosmos DB
SELECT food.servings[0].amount
FROM ROOT food
WHERE food.id = "19015"
order by food.servings[0].amount
Should it work?
Is there a document somewhere that covers all the queries you can run against this API?
(extra info)
(1) Go to https://www.documentdb.com/sql/demo
(2) Put this query in against it
SELECT food.servings[0].amount
FROM ROOT food
WHERE food.id = "19015"
order by food.servings[0].amount
It works, but this query looks nothing like the example in https://learn.microsoft.com/en-us/azure/cosmos-db/tutorial-query-sql-api#example-query-2, it uses a '[0]' which isn't needed in the original example.