MongoDB MCQ Questions - Collection

This section focuses on "Collection" in MongoDB. These Multiple Choice Questions (MCQs) should be practiced to improve the MongoDB skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.

1. A __________ is a grouping of MongoDB documents.

A. database
B. node
C. collection
D. table

View Answer


2. What is true about collection?

A. Documents within a collection can have different fields. 
B. A collection is the equivalent of a table in a relational database system.
C. A collection exists within a single database.
D. All of the above

View Answer


3. MongoDB ____________ is used to create collection.

A. db.insertCollection(name, options)
B. db.createCollection(name, options)
C. db.useCollection(name, options)
D. db.Collection(name, options)

View Answer


4. How many options parameter there during create collection?

A. 1
B. 2
C. 3
D. 4

View Answer


5. MongoDB ___________ is used to drop a collection from the database.

A. db.dropCollection()
B. db.collection.delete()
C. db.collection.drop()
D. db.deleteCollection()

View Answer


6. drop() method will return _____, if the selected collection is dropped successfully, otherwise it will return ___________.

A. true, true
B. false, false
C. true, false
D. false, true

View Answer


7. Type of parameter Name is?

A. String
B. Integer
C. Boolean
D. Array

View Answer


8. Type of optional field capped is?

A. String
B. Document
C. Number
D. Boolean

View Answer


9. Default value of autoIndexId is?

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


10. Size specifies a maximum size in bytes for a capped collection.

A. Yes
B. No
C. Can be yes or no
D. Can not say

View Answer





Discussion



* You must be logged in to add comment.