Sail E0 Webinar

MCQs

Total Questions : 50 | Page 3 of 5 pages
Question 21. In an MongoDB mapReduce command, the reduce function should ____
  1.    access the database
  2.    be called only when the key has a single value
  3.    access the database only to perform read operations
  4.    not access the data
 Discuss Question
Answer: Option D. -> not access the data
Question 22. Given a cursor named myCursor, which command returns a boolean value?
  1.    myCursor.hasNext()
  2.    myCursor.sort()
  3.    myCursor.next()
  4.    myCursor.find()
 Discuss Question
Answer: Option A. -> myCursor.hasNext()
Question 23. Why are ad-hoc queries useful?
  1.    They do not have to use the same operators.
  2.    You do not need to structure the database to support them.
  3.    They autogenerate reports.
  4.    They run faster than indexed queries.
 Discuss Question
Answer: Option D. -> They run faster than indexed queries.
Question 24. You are going to do a series of updates to multiple records
  1.    Use the replaceMany() command instead
  2.    Use the updateMulti() command instead
  3.    Use the updateMany() command instead
 Discuss Question
Answer: Option C. -> Use the updateMany() command instead
Question 25. What is NOT a standard role in MongoDB?
  1.    restore
  2.    read/write
  3.    dbadmin
  4.    delete collections
 Discuss Question
Answer: Option C. -> dbadmin
Question 26. You have two text fields in your document and you’d like both to be quickly searchable
  1.    Create a text index on each field.
  2.    MongoDB is not able to do this.
  3.    Create a compound text index using both fields.
  4.    Create a text index on one field and a single field index on the other.
 Discuss Question
Answer: Option A. -> Create a text index on each field.
Question 27. How often do the members of a replica set send heartbeats to each other?
  1.    every 2 minutes
  2.    every 5 seconds
  3.    every 2 seconds
  4.    every 10 seconds
 Discuss Question
Answer: Option C. -> every 2 seconds
Question 28. You need to get the names of all the indexes on your current collection
  1.    db.people.getName();
  2.    db.people.reIndex({names: 1});
  3.    db.people.getIndexKeys();
  4.    db.people.getIndexes();
 Discuss Question
Answer: Option C. -> db.people.getIndexKeys();
Question 29. Given an ObjectId in _id, how do you get the time it was created?
  1.    getDateTime(_id)
  2.    _id.createDate()
  3.    _id.getTimestamp()
  4.    _id.getDateTime()
 Discuss Question
Answer: Option C. -> _id.getTimestamp()
Question 30. Which MongoDB shell command deletes a single document?
  1.    db.customers.delete({_id: 1});
  2.    db.customers.drop({_id: 1});
  3.    db.drop.customers({_id: 1});
  4.    db.customers.remove({_id: 1});
 Discuss Question
Answer: Option D. -> db.customers.remove({_id: 1});

Latest Videos

Latest Test Papers