MongoDB Questions and Answers – MongoDB documents – 2

«
»

This set of MongoDB Test focuses on “MongoDB Documents – 2”.

1. Which of the following data structures are documents in MongoDB?
a) All database records
b) Query selectors
c) Update definitions
d) All of the mentioned
View Answer

Answer: d
Explanation: Most user-accessible data structures in MongoDB are documents.

advertisement

2. Point out the correct statement.
a) Update definitions define what fields to modify during an update
b) Query specifications, which define what fields to index
c) Index selectors, which define what records to select for read, update, and delete operations
d) All of the mentioned
View Answer

Answer: a
Explanation: MongoDB stores all data in documents, which are JSON-style data structures composed of field-and-value pairs.

3. An application communicates with MongoDB by way of a client library, called _____________
a) Driver
b) Parent
c) Rank
d) None of the mentioned
View Answer

Answer: a
Explanation: Driver handles all interaction with the database in a language appropriate to the application.
advertisement
advertisement

4. User-defined indexes on multiple fields is called ___________
a) composite index
b) secondary index
c) compound index
d) none of the mentioned
View Answer

Answer: c
Explanation: The order of fields listed in a compound index has significance.

5. If your driver has a version number of 2.9.1, What is the major version?
a) 1
b) 2
c) 9
d) None of the mentioned
View Answer

Answer: b
Explanation: Driver version numbers use semantic versioning or “major.minor.patch” versioning system.

advertisement

6. Updates that include _________ of field names may result in the reordering of fields in the document.
a) Renaming
b) Joining
c) Nesting
d) None of the mentioned
View Answer

Answer: a
Explanation: The $rename operator updates the name of a field.

7. The $rename operator logically performs a _______ of both the old name and the new name.
a) $unset
b) $set
c) $Nested
d) None of the mentioned
View Answer

Answer: a
Explanation: If the field to rename does not exist in a document, $rename does nothing.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

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

To practice all areas of MongoDB for various tests, Here is complete set of 1000+ Multiple Choice Questions and Answers.
advertisement

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