In this document model, the relationships between data are maintained by storing data in a single document. Here, we do not create a separate document to define a relationship. We can embed the document structure in a field or array within the document. These documents are denormalized. This allows us to retrieve data in a single operation, but it unnecessarily increases the size of the document.
The embedded document structure allows us to store related pieces of data in the same document. This also allows us to update a single document without worrying about data consistency.
The embedded document structure is used in two cases:
- When there is a one-to-one relationship with the embedded document. We can store the ...