
- MongoDB Tutorial
- MongoDB - Home
- MongoDB - Overview
- MongoDB - Advantages
- MongoDB - Environment
- MongoDB - Data Modeling
- MongoDB - Create Database
- MongoDB - Drop Database
- MongoDB - Create Collection
- MongoDB - Drop Collection
- MongoDB - Data Types
- MongoDB - Insert Document
- MongoDB - Query Document
- MongoDB - Update Document
- MongoDB - Delete Document
- MongoDB - Projection
- MongoDB - Limiting Records
- MongoDB - Sorting Records
- MongoDB - Indexing
- MongoDB - Aggregation
- MongoDB - Replication
- MongoDB - Sharding
- MongoDB - Create Backup
- MongoDB - Deployment
- MongoDB - Java
- MongoDB - PHP
- Advanced MongoDB
- MongoDB - Relationships
- MongoDB - Database References
- MongoDB - Covered Queries
- MongoDB - Analyzing Queries
- MongoDB - Atomic Operations
- MongoDB - Advanced Indexing
- MongoDB - Indexing Limitations
- MongoDB - ObjectId
- MongoDB - Map Reduce
- MongoDB - Text Search
- MongoDB - Regular Expression
- Working with Rockmongo
- MongoDB - GridFS
- MongoDB - Capped Collections
- Auto-Increment Sequence
- MongoDB Useful Resources
- MongoDB - Questions and Answers
- MongoDB - Quick Guide
- MongoDB - Useful Resources
- MongoDB - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MongoDB Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to MongoDB Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Q 1 - The MongoDB explain() method does not support which of the following verbosity mode:
Answer : D
Explanation
The possible modes of explain() are: "queryPlanner", "executionStats", and "allPlansExecution".
Q 2 - Which of the following is true about sharding?
A - Sharding is enabled at the database level
B - Creating a sharded key automatically creates an index on the collection using that key
C - We cannot change a shard key directly/automatically once it is set up
Answer : C
Explanation
There is no direct way of changing the sharded key unless you dump the entire data, drop the sharded key and then re-import everything. Other all options are false. Sharding is enabled at collection level, it does not create any index by default and finally sharding environment supports regular sorting.
Q 3 - Which of the following is supported by MongoDB?
B - Relationships between Collections (Primary Key – Foreign Key)
Answer : C
Explanation
MongoDB does not support things like ACID Transactions or atomicity across collections or relationships like SQL.
Q 4 - Consider that you are using { upsert : true } option in your update command. Which of the following parameters will be used to determine if any new documents were inserted:
Answer : D
Explanation
The nUpserted shows the number of documents that were added during the update operation.
Answer : A
Explanation
MongoDB is written in C++.
Q 6 - Which is the correct order (lowest to highest) in which MongoDB compares the BSON types?
A - Null, Number, String and Object
B - Number, Null, String and Object
Answer : A
Explanation
This is the defined order in which the bson types are compared. There are various other fields as per the BSON specification which can be found here: http://docs.mongodb.org/manual/reference/bson-types/
Q 7 - Which of the following command inside aggregate command is used in MongoDB aggregation to filter the documents to pass only the documents that match the specified condition(s) to the next pipeline stage.
Answer : B
Explanation
$match filters the documents to pass only the documents that match the specified condition(s) to the next pipeline stage.
Q 8 - Given the following posts document:
{ "_id" : 1, "post_text" : "This post does not matter”, “tags”: [ "tutorial", "fun", "learning"], // rest of the document }
What will be the output of following query:
db.posts.aggregate( [ { $unwind : "$tags" } ] )
A - Return three separate documents for three separate tags
B - Arranges the tags (wind) in ascending order
C - Arranges the tags (wind) in descending order
D - Returns one document but converts the tags array in an object
Answer : A
Explanation
Deconstructs an array field from the input documents to output a document for each element. Each output document is the input document with the value of the array field replaced by the element.
Q 9 - We can insert multiple documents in bulk using which of the following operations:
Answer : A
Explanation
The initializeUnorderedBulkOp operation returns an unordered operations builder which maintains a list of operations to perform. Unordered operations means that MongoDB can execute in parallel as well as in nondeterministic order.
Q 10 - If you have created a compound index on (A,B, C) which of the following access pattern will not be able to utilize the index?
Answer : C
Explanation
Since the index itself starts from A, it cannot be utilized it the input query is starting with B.