Show List 
                                    
                                            Quiz - MongoDB - 4
 Select the right answer for below questions:
What is the syntax for using the $nin operator in MongoDB?
 db.collection.find({ field: { $in: [value1, value2] } })
 db.collection.find({ field: { $all: [value1, value2] } })
 db.collection.find({ field: { $nin: [value1, value2] } })
db.collection.find({ field: { $nin: [value1, value2] } })
What is sharding in MongoDB?
 A way to store data in MongoDB
 A way to partition data across multiple servers in MongoDB
 A way to index data in MongoDB
A way to partition data across multiple servers in MongoDB
What is the syntax for enabling sharding in MongoDB?
 db.enableSharding(database_name)
 mongod.enableSharding(database_name)
 sh.enableSharding(database_name)
sh.enableSharding(database_name)
What is a shard key in MongoDB?
 A key that is used to encrypt data in MongoDB
 A key that is used to partition data across multiple servers in MongoDB
 A key that is used to index data in MongoDB
A key that is used to partition data across multiple servers in MongoDB
What is the syntax for creating a sharded collection in MongoDB?
 db.createCollection(collection_name, { shardKey: { field_name: 1 } })
 sh.createCollection(collection_name, { shardKey: { field_name: 1 } })
 mongod.createCollection(collection_name, { shardKey: { field_name: 1 } })
db.createCollection(collection_name, { shardKey: { field_name: 1 } })
What is a chunk in MongoDB?
 A unit of data that is stored in a sharded collection in MongoDB
 A unit of data that is indexed in MongoDB
 A unit of data that is partitioned across multiple servers in MongoDB
A unit of data that is partitioned across multiple servers in MongoDB
What is the syntax for manually splitting a chunk in MongoDB?
 sh.splitAt("database.collection", { field_name: value })
 db.splitAt("database.collection", { field_name: value })
 mongod.splitAt("database.collection", { field_name: value })
sh.splitAt("database.collection", { field_name: value })
What is the syntax for moving a chunk to a different shard in MongoDB?
 sh.moveChunk("database.collection", { field_name: value }, "shard_name")
 db.moveChunk("database.collection", { field_name: value }, "shard_name")
 mongod.moveChunk("database.collection", { field_name: value }, "shard_name")
sh.moveChunk("database.collection", { field_name: value }, "shard_name")
What is a distributed lock in MongoDB?
 A lock that is used to encrypt data in MongoDB
 A lock that is used to index data in MongoDB
 A lock that is used to prevent multiple processes from accessing the same data in MongoDB
A lock that is used to prevent multiple processes from accessing the same data in MongoDB
What is the syntax for acquiring a distributed lock in MongoDB?
 db.locks.acquire({ name: "lock_name", timeout: 10000 })
 sh.locks.acquire({ name: "lock_name", timeout: 10000 })
 mongod.locks.acquire({ name: "lock_name", timeout: 10000 })
db.locks.acquire({ name: "lock_name", timeout: 10000 })
 Submit 
 Retry 
{"qz1-263020":"db.collection.find({ field: { $nin: [value1, value2] } })","qz1-263021":"A way to partition data across multiple servers in MongoDB","qz1-263022":"sh.enableSharding(database_name)","qz1-263023":"A key that is used to partition data across multiple servers in MongoDB","qz1-263024":"db.createCollection(collection_name, { shardKey: { field_name: 1 } })","qz1-263025":"A unit of data that is partitioned across multiple servers in MongoDB","qz1-263026":"sh.splitAt(\"database.collection\", { field_name: value })","qz1-263027":"sh.moveChunk(\"database.collection\", { field_name: value }, \"shard_name\")","qz1-263028":"A lock that is used to prevent multiple processes from accessing the same data in MongoDB","qz1-263029":"db.locks.acquire({ name: \"lock_name\", timeout: 10000 })"}
Leave a Comment