MongoDB Questions and Answers Part-22

1. Point out the wrong statement.
a) Some documents created by internal MongoDB processes may have duplicate fields
b) no MongoDB process will ever add duplicate fields to an existing user document
c) The maximum BSON document size is 16 megabytes
d) None of the mentioned

Answer: c
Explanation: The maximum document size helps ensure that a single document cannot use excessive amount of RAM or, during transmission, excessive amount of bandwidth.

2. To store documents larger than the maximum size, MongoDB provides the _______ API.
a) Grid
b) MMS
c) GridFS
d) None of the mentioned

Answer: c
Explanation: MongoDB preserves the order of the document fields following write operations.

3. Index keys that are of the _______ type are more efficiently stored in the index.
a) Materialized Paths
b) BinData
c) String
d) None of the mentioned

Answer: b
Explanation: Most MongoDB driver clients will include the _id field and generate an ObjectId before sending the insert operation to MongoDB.

4. MongoDB uses the ________ notation to access the elements of an array and to access the fields of an embedded document.
a) Dot
b) Array
c) Nested Sets
d) None of the mentioned

Answer: a
Explanation: To access an element of an array by the zero-based index position, concatenate the array name with the dot (.) and zero-based index position, and enclose in quotes.

5. To get a correct snapshot of a running mongod process, you must have _________ enabled.
a) journaling
b) replication
c) MMS
d) all of the mentioned

Answer: a
Explanation: Without journaling enabled, there is no guarantee that the snapshot will be consistent or valid.

6. Point out the correct statement.
a) Journal must reside on the same logical volume as the other MongoDB data files
b) To get a consistent snapshot of a sharded system, you must disable the balancer
c) Backups produced by copying the underlying data do not support point in time recovery
d) All of the mentioned

Answer: d
Explanation: They are difficult to manage for larger sharded clusters.

7. The _______ tool reads data from a MongoDB database and creates high fidelity BSON files.
a) mdump
b) mongodump
c) mongod
d) all of the mentioned

Answer: b
Explanation: mongodump is a utility for creating a binary export of the contents of a database.

8. If your storage system does not support snapshots, you can copy the files directly using ____________
a) cp
b) copy
c) snap
d) none of the mentioned

Answer: a
Explanation: Since copying multiple files is not an atomic operation, you must stop all writes to the mongod before copying the files.

9. Point out the wrong statement.
a) MongoDB Cloud Manager Backup offers point in time recovery of MongoDB replica sets
b) MongoDB Cloud Manager continually backs up MongoDB replica sets
c) MMS achieves point in time recovery by storing oplog data
d) None of the mentioned

Answer: c
Explanation: MongoDB Cloud Manager Backup also offers a consistent snapshot of sharded clusters.

10. The _________ tool can populate a MongoDB database with the data from these BSON files.
a) mongostore
b) mongorestore
c) mongod
d) none of the mentioned

Answer: b
Explanation: This tool is not ideal for capturing backups of larger systems.