Relationships in MongoDB are crucial for modeling connections between data, similar to relational databases. By understanding One-to-One, One-to-Many, and Many-to-Many relationships, developers can design efficient schemas based on the application’s requirements. These MCQs help candidates learn the differences between embedding and referencing, optimize queries using $lookup, and handle real-world situations.
1.) What is the purpose of relationships in MongoDB?
2.) Which of the following is a type of relationship in MongoDB?
3.) How are One-to-One relationships typically modeled in MongoDB?
4.) What is the preferred approach for a One-to-Many relationship when the “many” side has few documents?
5.) What does the $lookup stage in aggregation do?
6.) Which method fetches related documents using manual references?
7.) How are Many-to-Many relationships typically implemented in MongoDB?
8.) What is an advantage of using embedded documents over references?
9.) Which is a drawback of embedding data for relationships?
10.) In a normalized data model, where are related data stored?