This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “CRUD Concepts”.
1. A query may include a ___________ that specifies the fields from the matching documents to return.
a) selection
b) projection
c) union
d) none of the mentioned
View Answer
Explanation: Queries specify criteria, or conditions, that identify the documents that MongoDB returns to the clients.
2. Point out the correct statement.
a) Secondary indexes allow applications to store a view of a portion of the collection in an efficient data structure
b) MongoDB has full support for secondary indexes
c) Most indexes store an ordered representation of all values of a field or a group of fields
d) All of the mentioned
View Answer
Explanation: Secondary indexes are used to enhance the performance of common queries and updates.
3. MongoDB stores all documents in _____________
a) tables
b) collections
c) rows
d) all of the mentioned
View Answer
Explanation: Collections are analogous to a table in relational databases.
4. In MongoDB _________ operations modify the data of a single collection.
a) CRUD
b) GRID
c) READ
d) All of the mentioned
View Answer
Explanation: Data modification refers to operations that create, update, or delete data.
5. Point out the wrong statement.
a) Indexes cannot enforce uniqueness in collection
b) CRUD stands for create, read, update, and delete
c) CRUD application is the most simplest application
d) All of the mentioned
View Answer
Explanation: Indexes may also enforce uniqueness, store objects in a geospatial representation, and facilitate text search.
6. Which of the following operation adds a new document to the users collection?
a) add
b) insert
c) truncate
d) drop
View Answer
Explanation: For the update and delete operations, you can specify the criteria to select the documents to update or remove.
7. Which of the following preference determines how the client direct read operations to the set?
a) read
b) write
c) update
d) delete
View Answer
Explanation: For replica sets and sharded clusters with replica set components, applications specify read preferences.
8. Applications can also control the behavior of write operations using _______ concern.
a) read
b) write
c) truncate
d) all of the mentioned
View Answer
Explanation: Write concern semantics allow clients to specify the assurance that MongoDB provides when reporting on the success of a write operation.
9. MongoDB process collection of documents using _________ operations.
a) Hbase
b) Hive
c) Map-reduce
d) None of the mentioned
View Answer
Explanation: In addition to the basic queries, MongoDB provides several data aggregation features.
10. Which of the following pipeline is used for aggregation in MongoDB?
a) data processing
b) information processing
c) knowledge processing
d) none of the mentioned
View Answer
Explanation: MongoDB can return counts of the number of documents that match a query, or return the number of distinct values for a field.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Apply for Programming Internship
- Check MongoDB Books
- Check Information Technology Books
- Practice Programming MCQs