11.) Which of the following commands deletes a collection?
A) db.collection.delete()
B) db.collection.remove()
C) db.collection.drop()
D) db.removeCollection()
12.) Which of the following is used to update a document in a collection?
A) db.collection.update()
B) db.collection.modify()
C) db.collection.findAndUpdate()
D) db.collection.save()
13.) Which method retrieves only specific fields from documents?
A) db.collection.filter()
B) db.collection.projection()
C) db.collection.select()
D) db.collection.find({}, {field: 1})
14.) Which of the following commands drops a database?
A) db.dropDatabase()
B) db.removeDatabase()
C) db.deleteDatabase()
D) dropDatabase()
15.) What is the default identifier for every MongoDB document?
A) _index
B) _name
C) _id
D) _key
16.) Which of the following operators is used to match multiple values in MongoDB?
A) $and
B) $or
C) $match
D) $in
17.) What is the data type of the _id field by default?
A) String
B) Integer
C) ObjectId
D) Binary
18.) Which command retrieves the total number of documents in a collection?
A) db.collection.count()
B) db.collection.total()
C) db.collection.size()
D) db.collection.numDocuments()
19.) Which method is used to update multiple documents in a collection?
A) db.collection.update()
B) db.collection.updateMany()
C) db.collection.modifyMany()
D) db.collection.batchUpdate()
20.) Which data type is used to store an array of values in MongoDB?
A) Array
B) List
C) Set
D) Collection
Related