MongoDB Questions and Answers – CRUD Concepts

«
»

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

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

Answer: b
Explanation: Secondary indexes are used to enhance the performance of common queries and updates.

advertisement

3. MongoDB stores all documents in _____________
a) tables
b) collections
c) rows
d) all of the mentioned
View Answer

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

Answer: a
Explanation: Data modification refers to operations that create, update, or delete data.

Note: Join free Sanfoundry classes at Telegram or Youtube
advertisement
advertisement

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

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

Answer: b
Explanation: For the update and delete operations, you can specify the criteria to select the documents to update or remove.

Take MongoDB Practice Tests - Chapterwise!
Start the Test Now: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
advertisement

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

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

Answer: b
Explanation: Write concern semantics allow clients to specify the assurance that MongoDB provides when reporting on the success of a write operation.

advertisement

9. MongoDB process collection of documents using _________ operations.
a) Hbase
b) Hive
c) Map-reduce
d) None of the mentioned
View Answer

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

Answer: a
Explanation: MongoDB can return counts of the number of documents that match a query, or return the number of distinct values for a field.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Books in MongoDB.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). 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!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & technical discussions at Telegram SanfoundryClasses.