- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Data
Insert and Query JSON Documents in Cosmos DB
Azure Cosmos DB is a globally distributed, non-relational database that stores data in the form of JSON. Compared to relational tables, JSON objects more readily accommodate values in complex forms, such as arrays and nested objects. In this lab, you will build a small dataset for geocaching enthusiasts and then query that data using SQL-like syntax.
Lab Info
Table of Contents
-
Challenge
Create a New Container in an Existing Cosmos DB Database
- Assign an appropriate partition key to the container, based on the shave of the data you will be inserting.
- If you're not sure, yet, it is usually safe to use
idfor the partition key.
-
Challenge
Insert Three JSON Documents
The inserted documents (items) should include at least one of each of these elements that demonstrate how JSON differs from relational data tables:
- A property value that is an array
- A property value that is an object
-
Challenge
Write at Least Four SQL-like Queries
The queries over the inserted data should demonstrate techniques for selecting:
- All properties from all items (no filter) in the container
- A few properties from a few items, filtered on the partition key
- A few properties that are within a nested object, with no filter on the data
- A few properties that are within an arrar, with no filter on the data
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.