MongoDB Questions and Answers – MongoDB documents – 1

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “MongoDB documents – 1”.

1. The __________ JavaScript shell and the MongoDB language drivers translate between BSON and the language-specific document representation.
a) mongod
b) mongo
c) iscript
d) none of the mentioned
View Answer

Answer: b
Explanation: The value of a field can be any of the BSON data types.

2. Point out the correct statement.
a) MongoDB stores chunks on disk in the XML serialization format
b) MongoDB stores documents on disk in the BSON serialization format
c) MongoDB stores documents on RAM in the JSON serialization format
d) All of the mentioned
View Answer

Answer: a
Explanation: BSON documents may have more than one field with the same name.

3. BSON is a binary representation of ________ documents.
a) JSON
b) XML
c) JScript
d) All of the mentioned
View Answer

Answer: a
Explanation: BSON contains more data types than JSON.

4. MongoDB documents are composed of field-and-value pairs and have the following structure?
a) field1:; value1
b) field1: value1;
c) field1: value1
d) none of the mentioned
View Answer

Answer: c
Explanation: The value of a field can be any of the BSON data types, including other documents, arrays, and arrays of documents.

advertisement
advertisement

5. 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
View Answer

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.

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

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

7. 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
View Answer

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

8. 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
View Answer

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.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Books in MongoDB.

advertisement

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

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 & discussions at Telegram SanfoundryClasses.