Mongodb Certified Developer Associate C100dev · Free Practice Question Medium
Question 27
When modeling a relationship between two entities in MongoDB, what is the purpose of using an embedded relationship?
-
A
The purpose of using an embedded relationship in MongoDB is to denormalize the data, duplicating data across multiple documents to improve query performance.
-
B
The purpose of using an embedded relationship in MongoDB is to store related entities in separate collections, improving scalability and maintainability of the data.
-
C
The purpose of using an embedded relationship in MongoDB is to store multiple related entities in two documents.
-
D
The purpose of using an embedded relationship in MongoDB is to store multiple related entities in a single document to reduce the need for joins.
Reveal correct answer
Correct answer: D
A.
While embedded relationships do involve denormalization, the primary purpose is not to duplicate data across multiple documents, but rather to store related entities together in a single document.
B.
This describes a referenced relationship, not an embedded one. In an embedded relationship, the related entities are stored within the same document, not in separate collections.
C.
An embedded relationship stores related entities within a single document, not across multiple documents. The goal is to keep the related data together in one place.
D.
Embedded relationships in MongoDB allow related data to be stored together in a single document. This reduces the need for complex joins (which are common in relational databases) and improves query performance by keeping related data together.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
