- 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
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 - Which of the following is correct about MongoDB?
A - MongoDB uses JSON format to represent documents
B - MongoDB supports collection joins
Answer : D
Explanation
MongoDB provides specific supports for functionalities related to 2d and 3d geospatial problems.
Q 2 - What is the maximum size of a MongoDB document?
Answer : B
Explanation
The maximum BSON document size is 16 megabytes. The maximum document size helps ensure that a single document cannot use excessive amount of RAM or, during transmission, excessive amount of bandwidth.
Q 3 - Which of the following operations on a single document will operate atomically?
Answer : C
Explanation
Both the update and $push operators will operate in an atomic way.
Q 4 - Which option can be used with update command so that a new document gets created if no matching document is found based on the query condition?
A - Specify {upsert : true } as the third parameter of update command
B - upsert command instead of update command
C - {update: true, insert: true} as the third parameter of update command
Answer : A
Explanation
When you specify upsert: true for an update operation and no matching documents are found, MongoDB creates a new document.
Q 5 - What does the totalKeysExamined field returned by the explain method indicate?
A - Number of documents that match the query condition
B - Number of index entries scanned
C - Number of documents scanned
D - Details the completed execution of the winning plan as a tree of stages
Answer : B
Explanation
explain.executionStats.totalKeysExamined indicates the number of index entries scanned.
Answer : B
Explanation
By default GridFS limits chunk size to 255k.
Q 7 - In a sharded replica set environment, the w Option provides ability for write concern and j Option provides ability for the data to be written on disk journal. Consider that we have a seven member replica set and we want to assure that the writes are committed to journal. What should be the value of j?
Answer : B
Explanation
To enable the disk journaling commits, j value should always be set to 1.
Q 8 - Which of the following SQL terminology is same as $match in MongoDB?
Answer : C
Explanation
In MongoDB, we use $match as the aggregation operator corresponding to WHERE and HAVING condition in MongoDB.
Q 9 - The oplog (operations log) is a special capped collection that keeps a rolling record of all operations that modify the data stored in your databases. All the replica set members contain a copy of the oplog in the following collection:
Answer : B
Explanation
All replica set members contain a copy of the oplog, in the local.oplog.rs collection, which allows them to maintain the current state of the database.
Q 10 - When should we consider representing a one-to-many relationship in an embedded collection instead of separate collection?
A - When the many is very large
Answer : B
Explanation
If the many is very large, then we should create separate collection, else the document size would go on increasing.
To Continue Learning Please Login
Login with Google