Sail E0 Webinar

MCQs

Total Questions : 50 | Page 4 of 5 pages
Question 31. Which query bypasses the first 5 customers and returns the next 10?
  1.    db.customers.find({}, {skip: 5, limit: 10})
  2.    db.customers.find({}.page(5).take(10))
  3.    db.customers.find({}).skip(5).take(10)
  4.    db.customers.find({}).skip(5).limit(10)
 Discuss Question
Answer: Option D. -> db.customers.find({}).skip(5).limit(10)
Question 32. You would like to know how many different categories you have
  1.    db.vehicle.distinct(“category”)
  2.    db.vehicle.unique(“category”)
  3.    db.vehicle.distinct(“category”).count()
  4.    db.vehicle.distinct(“category”).length
 Discuss Question
Answer: Option C. -> db.vehicle.distinct(“category”).count()
Question 33. Which shell query displays all citizens with an age greater than or equal to 21?
  1.    db.citizens.select(‘WHERE age >= 21’)
  2.    db.citizens.where(‘age >= 21’)
  3.    db.citizens.find(‘WHERE age >= 21’)
  4.    db.citizens.find({age: {$gte: 21}})
 Discuss Question
Answer: Option D. -> db.citizens.find({age: {$gte: 21}})
Question 34. A MongoDB instance has at least what three files?
  1.    data, namespace, and journal
  2.    namespace, journal, and log
  3.    journal, data, and database
  4.    data, log, and journal
 Discuss Question
Answer: Option B. -> namespace, journal, and log
Question 35. Which field is required of all MongoDB documents?
  1.    _id
  2.    _name
  3.    ObjectId
  4.    mongoDB is schema-less so no field is required
 Discuss Question
Answer: Option A. -> _id
Question 36. You need to delete the index you created on the description field
  1.    db.vehicle.dropIndex(“description_text”)
  2.    db.vehicle.dropIndex({“description”:”text”})
  3.    db.vehicle.removeIndex({“description”:”text”})
  4.    db.vehicle.removeIndex(“description_text”)
 Discuss Question
Answer: Option A. -> db.vehicle.dropIndex(“description_text”)
Question 37. MongoDB ships with a variety of files
  1.    mongo
  2.    mongo-s
  3.    shell
 Discuss Question
Answer: Option A. -> mongo
Question 38. You want to modify an existing index
  1.    Use the reIndex() command to modify the index.
  2.    Delete the original index and create a new index.
  3.    Call the createIndex() command with the update option.
  4.    Use the updateIndex() command.
 Discuss Question
Answer: Option B. -> Delete the original index and create a new index.
Question 39. Which MongoDB shell command should you use to back up a database?
  1.    restore
  2.    backup
  3.    mongobackup
  4.    mongodump
 Discuss Question
Answer: Option D. -> mongodump
Question 40. Given a cursor named myCursor, pointing to the customers collection, how to you get basic info about it?
  1.    myCursor.stats()
  2.    myCursor.dump()
  3.    myCursor.info()
  4.    myCursor.explain()
 Discuss Question
Answer: Option D. -> myCursor.explain()

Latest Videos

Latest Test Papers