Hi CosmosDB Community !!!
I'd like to contribute with some posts about how to query Cosmos DB Collection with SQL API.
Suppose we have a speaker list of differents events around a whole world.
The link above represent speaker list example.
Example1.json
For all examples we will use Data Explore in Azure Portal. Anyway, you can use any API in any supported programming language to write your queries. We are not using Modeling data techniques or witting same data in different ways to avoid cross partition queries. The main objective of the post is how to use built-in functions and operators in CosmosDB SQL API.
I'd like to list all events from Hassan Arteaga Rodríguez
Query
SELECT * FROM c where c.speaker = "Hassan Arteaga Rodriguez"
Results
I need to list all events from MEXICO. Not all fields
Query
SELECT c.speaker, c.event_name,c.init_date,c.end_date FROM c where c.event_country = "MEXICO"
Results
Comments