MongoDB Questions and Answers – Data Modeling Concepts – 1

«
»

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

Answer: b
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

Answer: b
Explanation: Effective data models support your application needs.

advertisement

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

Answer: a
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

Answer: b
Explanation: Normalized data models can require more round trips to the server.

advertisement
advertisement

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

Answer: d
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

Answer: b
Explanation: References provides more flexibility than embedding.

advertisement

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

Answer: a
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

Answer: c
Explanation: The limit on the number of namespaces depend on the <database>.ns size.

advertisement

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

Answer: b
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

Answer: a
Explanation: Capped collections efficiently support operations that insert and read documents based on insertion order.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Reference Books in MongoDB.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!
advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter