Show List
Quiz - MongoDB - 5
Select the right answer for below questions:
What is the syntax for releasing a distributed lock in MongoDB?
db.locks.release({ name: "lock_name" })
sh.locks.release({ name: "lock_name" })
mongod.locks.release({ name: "lock_name" })
db.locks.release({ name: "lock_name" })
What is the maximum size of a single document in MongoDB?
4 MB
16 MB
64 MB
64 MB
What is the syntax for creating an index on a MongoDB collection?
db.collection.createIndex({ field_name: 1 })
db.createIndex(collection_name, { field_name: 1 })
mongod.createIndex(collection_name, { field_name: 1 })
db.collection.createIndex({ field_name: 1 })
What is a compound index in MongoDB?
An index that is made up of multiple documents in a single collection
An index that is made up of multiple collections in a single database
An index that is made up of multiple fields in a single document
An index that is made up of multiple fields in a single document
What is the syntax for creating a compound index in MongoDB?
db.collection.createIndex({ field_name_1: 1, field_name_2: 1 })
db.createCompoundIndex(collection_name, { field_name_1: 1, field_name_2: 1 })
mongod.createCompoundIndex(collection_name, { field_name_1: 1, field_name_2: 1 })
db.collection.createIndex({ field_name_1: 1, field_name_2: 1 })
What is the purpose of the explain() method in MongoDB?
To display information about a query's performance
To display information about a document's structure
To display information about a database's schema
To display information about a query's performance
What is the syntax for using the explain() method in MongoDB?
db.collection.find({ field_name: value }).explain()
db.explain(collection_name, { field_name: value })
mongod.explain(collection_name, { field_name: value })
db.collection.find({ field_name: value }).explain()
What is a covered query in MongoDB?
A query that retrieves all fields in a collection
A query that only uses the index to retrieve data
A query that updates all fields in a collection
A query that only uses the index to retrieve data
What is the syntax for creating a covered query in MongoDB?
db.createCoveredQuery(collection_name, { field_name: value })
mongod.createCoveredQuery(collection_name, { field_name: value })
db.collection.find({ field_name: value }, { _id: 0, field_name: 1 })
db.collection.find({ field_name: value }, { _id: 0, field_name: 1 })
What is a TTL index in MongoDB?
An index that automatically updates documents after a specified time
An index that automatically deletes documents after a specified time
An index that automatically creates new collections after a specified time
An index that automatically deletes documents after a specified time
Submit
Retry
{"qz1-232661":"db.locks.release({ name: \"lock_name\" })","qz1-232662":"64 MB","qz1-232663":"db.collection.createIndex({ field_name: 1 })","qz1-232664":"An index that is made up of multiple fields in a single document","qz1-232665":"db.collection.createIndex({ field_name_1: 1, field_name_2: 1 })","qz1-232666":"To display information about a query's performance","qz1-232667":"db.collection.find({ field_name: value }).explain()","qz1-232668":"A query that only uses the index to retrieve data","qz1-232669":"db.collection.find({ field_name: value }, { _id: 0, field_name: 1 })","qz1-232670":"An index that automatically deletes documents after a specified time"}
Leave a Comment