This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Data Modeling Concepts – 1”.
1. ___________ data models allow applications to store related pieces of information in the same database record.
a) Reference
b) Embedded
c) External
d) None of the mentioned
View Answer
Explanation: As a result, applications may need to issue fewer queries and updates to complete common operations.
2. Point out the correct statement.
a) With MongoDB, you cannot embed related data in a single structure or document
b) The key consideration for the structure of your documents is the decision to embed or to use references
c) Reference schema is generally known as “denormalized” models
d) None of the mentioned
View Answer
Explanation: Effective data models support your application needs.
3. Embedded data model is used when you have _________ relationships between entities.
a) contains
b) isa
c) inheritance
d) all of the mentioned
View Answer
Explanation: Embedding provides better performance for read operations.
4. Normalized data models describe relationships using ___________ between documents.
a) relativeness
b) references
c) evaluation
d) none of the mentioned
View Answer
Explanation: Normalized data models can require more round trips to the server.
5. Point out the wrong statement.
a) Embedded data models make it possible to update related data in a single atomic write operation
b) Embedding related data in documents may lead to situations where documents grow after creation
c) With the MMAPv1 storage engine, document growth can impact write performance and lead to data fragmentation
d) All of the mentioned
View Answer
Explanation: In version 3.0.0, MongoDB uses Power of 2 Sized Allocations as the default allocation strategy for MMAPv1 in order to account for document growth, minimizing the likelihood of data fragmentation.
6. To interact with embedded documents, use ___________ notation to “reach into” embedded documents.
a) period
b) dot
c) comma
d) colon
View Answer
Explanation: References provides more flexibility than embedding.
7. MongoDB using the mmapv1 storage engine has limits on the number of __________
a) namespaces
b) collections
c) documents
d) none of the mentioned
View Answer
Explanation: The namespace file defaults to 16 MB.
8. To get the current number of namespaces in the mongo shell, use ________________
a) db.system.namespaces.countc()
b) db.system.namespaces.count(*)
c) db.system.namespaces.count()
d) all of the mentioned
View Answer
Explanation: The limit on the number of namespaces depend on the <database>.ns size.
9. The __________ feature of collections expires documents after a period of time.
a) TEL
b) TTL
c) TPL
d) None of the mentioned
View Answer
Explanation: Consider using the TTL feature if your application requires some data to persist in the database for a limited period of time.
10. Capped collections provide __________ management of inserted documents in MongoDB.
a) FIFO
b) LIFO
c) LRU
d) MRU
View Answer
Explanation: Capped collections efficiently support operations that insert and read documents based on insertion order.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Check Information Technology Books
- Check MongoDB Books
- Practice Programming MCQs
- Apply for Programming Internship