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
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
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
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
Explanation: The value of a field can be any of the BSON data types, including other documents, arrays, and arrays of documents.
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
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
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
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
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.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Practice Programming MCQs
- Apply for Programming Internship
- Check MongoDB Books
- Check Information Technology Books