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.

Questions and Answers

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?

A - 2 MB

B - 16 MB

C - 12 MB

D - There is no maximum size. It depends on the RAM.

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?

A - update

B - $push

C - Both a and b

D - None of the above

Answer : C

Explanation

Both the update and $push operators will operate in an atomic way.

Answer : A

Explanation

When you specify upsert: true for an update operation and no matching documents are found, MongoDB creates a new document.

Answer : B

Explanation

explain.executionStats.totalKeysExamined indicates the number of index entries scanned.

Q 6 - What is the default size of a GridFS chunk?

A - 16 MB

B - 255 K

C - 1 MB

D - 2 MB

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?

A - 0

B - 1

C - 2

D - 7

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?

A - WHERE

B - HAVING

C - Both WHERE and HAVING

D - GROUP BY

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:

A - oplog.rs

B - local.oplog.rs

C - <database>..oplog.rs

D - <replicasetid>.oplog.rs

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

B - When the many is not very large

C - Never

D - Always

Answer : B

Explanation

If the many is very large, then we should create separate collection, else the document size would go on increasing.

mongodb_questions_answers.htm
Advertisements