Sail E0 Webinar

MCQs

Total Questions : 10
Question 1. Point out the correct statement :
  1.    Both 2dsphere and 2d geospatial indexes support $geoWithin
  2.    $geoWithin does not require a geospatial index
  3.    The $geoWithin operator does not return sorted results
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> $geoWithin does not require a geospatial index


However, a geospatial index will improve query performance.


Question 2. To terminate an ongoing index build, use the __________ method in the mongo shell.
  1.    db.currentOp()
  2.    db.killOp()
  3.    db.removeOp()
  4.    All of the mentioned
 Discuss Question
Answer: Option B. -> db.killOp()


For index builds, the effects of db.killOp() may not be immediate and may occur well after much of the index build operation has completed.


Question 3. The background task that removes expired documents runs every ________ seconds.
  1.    15
  2.    45
  3.    60
  4.    120
 Discuss Question
Answer: Option C. -> 60


As a result, documents may remain in a collection during the period between the expiration of the document and the running of the background task.


Question 4. The _________ property for an index causes MongoDB to reject duplicate values for the indexed field.
  1.    Hashed
  2.    Unique
  3.    Multikey
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> Multikey


Other than the unique constraint, unique indexes are functionally interchangeable with other MongoDB indexes.


Question 5. For a _____ multikey index, each indexed document can have at most one indexed field whose value is an array.
  1.    Hashed
  2.    Unique
  3.    Multikey
  4.    compound
 Discuss Question
Answer: Option D. -> compound


As such, you cannot create a compound multikey index if more than one to-be-indexed field of a document is an array.


Question 6. The $geoWithin operator uses the _______ operator to specify the GeoJSON object.
  1.    $sphere
  2.    $geoin
  3.    $geometry
  4.    All of the mentioned
 Discuss Question
Answer: Option C. -> $geometry


For $geoWithin, if you specify a single-ringed polygon that has an area greater than a single hemisphere, include the custom MongoDB coordinate reference system in the $geometry expression.


Question 7. Point out the correct statement :
  1.    Applications can use $center without having a geospatial index
  2.    Before 3.0, a geospatial index must exist on a field holding coordinates before using any of the geospatial query operators
  3.    To use $centerSphere, specify an array that contains grid coordinates of the circle's center point
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> Applications can use $center without having a geospatial index


However, geospatial indexes support much faster queries than the unindexed equivalents.


Question 8. The ______ index is unique and prevents clients from inserting two documents with the same value for the _id field.
  1.    _id
  2.    $default
  3.    _def
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> _id


All MongoDB collections have an index on the _id field that exists by default.


Question 9. __________ method provides a wrapper around the totalIndexSize output of the collStats (i.e. db.collection.stats()) operation.
  1.    db.collection.totalallIndexSize()
  2.    db.collection.totalIndexSizeAll()
  3.    db.collection.totalIndexSize()
  4.    All of the mentioned
 Discuss Question
Answer: Option C. -> db.collection.totalIndexSize()


To check the size of your indexes, use the db.collection.totalIndexSize() helper, which returns data in bytes.


Question 10. Point out the correct statement :
  1.    After 2.4, you can terminate both background index builds and foreground index builds
  2.    The specified language in the document overrides the default language for the text index
  3.    The text index, like other indexes,should not fall within the index name length limit
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> The specified language in the document overrides the default language for the text index


To get the names of the indexes, use the db.collection.getIndexes() method.


Latest Videos

Latest Test Papers