In this chapter, we will write and run queries to retrieve data from documents in a collection. We will use the Cosmos DB dialect of SQL to work against a document database with the SQL API. We will understand the different ways of working with the documents, their sub-documents, and their arrays, and we will learn how queries consume resource units. We will do the following in this chapter:
- Run queries against a collection with different tools
- Understand query results in JSON arrays
- Check the request units spent by a query
- Work with schema-agnostic queries
- Use built-in array functions
- Work with joins
- Use array iteration
- Work with aggregate functions