This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Index Types – 2”.
1. Before version _______ capped collections did not have an _id field.
a) 2.1
b) 2.4
c) 3.0
d) 2.2
View Answer
Explanation: In version 2.2 and newer, capped collections do have an _id field, except those in the local database.
2. Point out the wrong statement.
a) You can create indexes on fields within embedded documents
b) Indexes on embedded fields are similar to indexes on embedded documents
c) Indexes on embedded fields allow you to use a “dot notation,” to introspect into embedded documents
d) None of the mentioned
View Answer
Explanation: Indexes on embedded fields differ from indexes on embedded documents, which include the full content up to the maximum index size of the embedded document in the index.
3. For a _____ multikey index, each indexed document can have at most one indexed field whose value is an array.
a) Hashed
b) Unique
c) Multikey
d) compound
View Answer
Explanation: As such, you cannot create a compound multikey index if more than one to-be-indexed field of a document is an array.
4. Which of the following indexes cannot be multikey?
a) Hashed
b) Unique
c) Multikey
d) compound
View Answer
Explanation: You cannot specify a multikey index as the shard key index.
5. Point out the wrong statement.
a) You may not create compound indexes that have hashed index fields
b) The order of the fields in a compound index is very important
c) You will receive a warning if you attempt to create a compound index that includes a hashed index
d) None of the mentioned
View Answer
Explanation: You will receive an error if you attempt to create a compound index that includes a hashed index.
6. To calculate geometry over an Earth-like sphere, store your location data on a spherical surface and use _____ index.
a) 2dsphere
b) 2d
c) geoHaystack
d) all of the mentioned
View Answer
Explanation: Secondary members replicate deletion operations from the primary.
7. ______ indexes can be constructed over arrays that hold both scalar values (e.g. strings, numbers) and nested documents.
a) Hashed
b) Unique
c) Multikey
d) Compound
View Answer
Explanation: Store your location data as GeoJSON objects with this coordinate-axis order: longitude, latitude.
8. The coordinate reference system for GeoJSON uses the _____ datum.
a) WGS88
b) WGS84
c) JGS88
d) None of the mentioned
View Answer
Explanation: Before storing your location data and writing queries, you must decide the type of surface to use to perform calculations.
9. Which of the following is used to calculate distances on a Euclidean plane?
a) 2dsph
b) 2d
c) geoHaystack
d) all of the mentioned
View Answer
Explanation: Store your location data as legacy coordinate pairs
10. Queries on ________ objects always calculate on a sphere.
a) GeoBSON
b) GeoJSON
c) geoJSONB
d) All of the mentioned
View Answer
Explanation: Support for GeoJSON storage and queries is new in version 2.4.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Check MongoDB Books
- Check Information Technology Books
- Apply for Programming Internship
- Practice Programming MCQs