quit() exit() db.shutdownServer() db.shutdown()[...]
Day: June 25, 2021
You are going to do a series of updates to multiple records. You find setting the multi option of the update() command too tiresome. What should you do instead?You are going to do a series of updates to multiple records. You find setting the multi option of the update() command too tiresome. What should you do instead?
Use the replaceMany() command instead Use the updateMulti() command instead Use the updateMany() command instead Set the global multi option[...]
You need to get the names of all the indexes on your current collection. What is the best way to accomplish this?You need to get the names of all the indexes on your current collection. What is the best way to accomplish this?
db.people.getName(); db.people.reIndex({names: 1}); db.people.getIndexKeys(); db.people.getIndexes();[...]
Using the MongoDB shell, how do you remove the customer collection and its indexes?Using the MongoDB shell, how do you remove the customer collection and its indexes?
db.customers.remove({}).indexes(); db.customers.remove({}); db.customers.drop(); db.customers.delete();[...]
Which MongoDB shell command deletes a single document?Which MongoDB shell command deletes a single document?
db.customers.delete({_id: 1}); db.customers.drop({_id: 1}); db.drop.customers({_id: 1}); db.customers.remove({_id: 1});[...]
What is NOT a standard role in MongoDB?What is NOT a standard role in MongoDB?
restore read/write dbadmin delete collections[...]
You’d like a set of documents to be returned in last name, ascending order. Which query will accomplish this?You’d like a set of documents to be returned in last name, ascending order. Which query will accomplish this?
db.persons.find().sort({lastName: -1}} db.persons.find().sort({lastName: 1}} db.persons.find().sort({lastName: ascending}} db.persons.find().sort({lastName: $asc}}[...]
A MongoDB instance has at least what three files?A MongoDB instance has at least what three files?
data, namespace, and journal namespace, journal, and log journal, data, and database data, log, and journal[...]
Which field is required of all MongoDB documents?Which field is required of all MongoDB documents?
_id _name ObjectId mongoDB is schema-less so no field is required[...]