Documents, JSON and Querying Them
A document database stores records as JSON-like documents. Nested data lives inside one document (an order with its lines), so one read fetches everything, and each document can have different fields. The cost is that the same fact is often copied into many documents, so keeping data consistent is up to you.
Querying means filtering the documents by field values, including nested ones. Python's json module turns documents to text and back.
Examplepython
Quick check
What is a drawback of copying the same data into many documents?
Your turn: write the code
Print the total quantity of all items ordered across the orders.
Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.
Tip: use the left and right arrow keys to move between lessons.