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
Explanation: Most user-accessible data structures in MongoDB are documents.
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
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
Explanation: Driver handles all interaction with the database in a language appropriate to the application.
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
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
Explanation: Driver version numbers use semantic versioning or “major.minor.patch” versioning system.
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
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
Explanation: If the field to rename does not exist in a document, $rename does nothing.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]
- Apply for Programming Internship
- Practice Programming MCQs
- Check MongoDB Books
- Check Information Technology Books