Show List

Quiz - MongoDB - 2

67%

Public Average Score
Select the right answer for below questions:

What is a GridFS in MongoDB?
A way to store small files in MongoDB
A way to store large files in MongoDB
A way to store images in MongoDB
A way to store large files in MongoDB

What is the difference between a collection and a document in MongoDB?
A collection is a group of documents, while a document is a single record in a collection
A collection is a single record, while a document is a group of collections
There is no difference between a collection and a document in MongoDB
A collection is a group of documents, while a document is a single record in a collection

What is the command to start the MongoDB server?
mongo
mongod
start mongod
mongod

What is the command to connect to the MongoDB server?
mongod
connect mongo
mongo
mongo

What is the syntax for inserting a document in a MongoDB collection?
db.collection.insertOne()
db.collection.insert()
db.collection.insertDocument()
db.collection.insertOne()

What is the syntax for updating a document in a MongoDB collection?
db.collection.update()
db.collection.updateDocument()
db.collection.updateOne()
db.collection.updateOne()

What is the role of the WiredTiger storage engine in MongoDB?
It is the default storage engine in MongoDB
It is an alternative storage engine in MongoDB
It is a way to index data in MongoDB
It is the default storage engine in MongoDB

What is the $lookup operator in MongoDB?
A way to filter data in MongoDB
A way to sort data in MongoDB
A way to join data from multiple collections in MongoDB
A way to join data from multiple collections in MongoDB

What is the syntax for using the $lookup operator in MongoDB?
db.collection.aggregate({$lookup: {from: "anotherCollection", localField: "field1", foreignField: "field2", as: "newField"}})
db.collection.find({$lookup: {from: "anotherCollection", localField: "field1", foreignField: "field2", as: "newField"}})
db.collection.update({$lookup: {from: "anotherCollection", localField: "field1", foreignField: "field2", as: "newField"}})
db.collection.aggregate({$lookup: {from: "anotherCollection", localField: "field1", foreignField: "field2", as: "newField"}})

What is the difference between the $push and $addToSet operators in MongoDB?
$push adds a value to an array, while $addToSet adds a value to an array only if it does not already exist
$addToSet adds a value to an array, while $push adds a value to an array only if it does not already exist
$push and $addToSet are the same operator in MongoDB
$push adds a value to an array, while $addToSet adds a value to an array only if it does not already exist

Submit
Retry
{"qz1-934591":"A way to store large files in MongoDB","qz1-934592":"A collection is a group of documents, while a document is a single record in a collection","qz1-934593":"mongod","qz1-934594":"mongo","qz1-934595":"db.collection.insertOne()","qz1-934596":"db.collection.updateOne()","qz1-934597":"It is the default storage engine in MongoDB","qz1-934598":"A way to join data from multiple collections in MongoDB","qz1-934599":"db.collection.aggregate({$lookup: {from: \"anotherCollection\", localField: \"field1\", foreignField: \"field2\", as: \"newField\"}})","qz1-934600":"$push adds a value to an array, while $addToSet adds a value to an array only if it does not already exist"}

    Leave a Comment


  • captcha text