Sail E0 Webinar

MCQs

Total Questions : 50 | Page 5 of 5 pages
Question 41. How do you find documents with a matching item in an embedded array?
  1.    db.customers.findmatch ({“jobs”:”secretary”})
  2.    db.customers.find ({“jobs:secretary”})
  3.    db.customers.find ({“jobs”:[“secretary”]})
  4.    db.customers.find ({“jobs”:”secretary”})
 Discuss Question
Answer: Option D. -> db.customers.find ({“jobs”:”secretary”})
Question 42. You’d like a set of documents to be returned in last name, ascending order
  1.    db.persons.find().sort({lastName: -1}}
  2.    db.persons.find().sort({lastName: 1}}
  3.    db.persons.find().sort({lastName: ascending}}
  4.    db.persons.find().sort({lastName: $asc}}
 Discuss Question
Answer: Option B. -> db.persons.find().sort({lastName: 1}}
Question 43. Which programming language is used to write MongoDB queries? (Alternative: In the MongoDB shell, what programming language is used to make queries?)
  1.    Python
  2.    JavaScript
  3.    SQL
  4.    TypeScript
 Discuss Question
Answer: Option B. -> JavaScript
Question 44. Which command returns all of the documents in the customers collection?
  1.    db.customers.all();
  2.    db.find().customers();
  3.    db.customers.find();
  4.    db.customers.show();
 Discuss Question
Answer: Option C. -> db.customers.find();
Question 45. By default, applications direct their read operations to which member of the replica set?
  1.    primary
  2.    arbiter
  3.    secondary
  4.    backup
 Discuss Question
Answer: Option B. -> arbiter
Question 46. You would like the stats() command to return kilobytes instead of bytes
  1.    db.vehicle.stats(1024)
  2.    db.vehicle.stats(“kilobytes”)
  3.    db.vehicle.stats(true)
  4.    db.vehicle.stats(“kb”)
 Discuss Question
Answer: Option A. -> db.vehicle.stats(1024)
Question 47. What is true about indexes?
  1.    They speed up read access while slowing down writes.
  2.    They secure the database from intruders.
  3.    They speed up reads and writes.
  4.    They speed up write access while slowing down reads.
 Discuss Question
Answer: Option A. -> They speed up read access while slowing down writes.
Question 48. On a newly created collection, which field will have an index?
  1.    the name field
  2.    the ObjectId field
  3.    the _id field
  4.    no field will have an index
 Discuss Question
Answer: Option C. -> the _id field
Question 49. What happens to a Replica set oplog if it runs out of memory?
  1.    The oplog will be saved on one of the secondary servers.
  2.    The oplog is capped collection and can’t run out of memory
  3.    The MongoDB instance will fail
  4.    The oplog will stop recording logging information
 Discuss Question
Answer: Option A. -> The oplog will be saved on one of the secondary servers.
Question 50. Choose the shell command that connects to a MongoDB database
  1.    mongo
  2.    mongod
  3.    mongoconnect
  4.    dbconnect
 Discuss Question
Answer: Option A. -> mongo

Latest Videos

Latest Test Papers