Explore topic-wise MCQs in Mongodb.

This section includes 29 Mcqs, each offering curated multiple-choice questions to sharpen your Mongodb knowledge and support exam preparation. Choose a topic below to get started.

1.

Index __________ does not eliminate the need for creating compound indexes.

A. union
B. addition
C. intersection
D. all of the mentioned
Answer» D. all of the mentioned
2.

Before version _______ capped collections did not have an _id field.

A. 2.1
B. 2.4
C. 3
D. 2.2
Answer» E.
3.

An index prefix is a subset of a ______ index, consisting of one or more keys starting from the beginning of the index.

A. Hashed
B. Unique
C. Sparse
D. Compound
Answer» E.
4.

Inclusion queries use the _________ operator in MongoDB.

A. $geokey
B. $geoin
C. $geoWithin
D. All of the mentioned
Answer» D. All of the mentioned
5.

Which of the following GeoJSON object is not supported in MongoDB ?

A. Point
B. LineString
C. MultiPoint
D. None of the mentioned
Answer» E.
6.

Queries on ________ objects always calculate on a sphere.

A. GeoBSON
B. GeoJSON
C. geoJSONB
D. All of the mentioned
Answer» C. geoJSONB
7.

MongoDB supports spherical surface calculations on legacy coordinate pairs using a _______ index

A. 2dsphere
B. 2d
C. geoHaystack
D. all of the mentioned
Answer» B. 2d
8.

___________ indexes use spherical geometry to return results.

A. 3sphere
B. 2sphere
C. 1sphere
D. none of the mentioned
Answer» C. 1sphere
9.

_____ indexes uses planar geometry when returning results.

A. 2d
B. 1d
C. 3d
D. All of the mentioned
Answer» B. 1d
10.

________ index must exist on a field holding coordinates before using any of the geospatial query operators.

A. Unique
B. Geospatial
C. Temporal
D. All of the mentioned
Answer» C. Temporal
11.

The _________ operator specifies a circle for a $geoWithin query.

A. $within
B. $gwithin
C. $center
D. All of the mentioned
Answer» D. All of the mentioned
12.

The default weight is ____ for the indexed fields.

A. 1
B. 2
C. 3
D. 4
Answer» B. 2
13.

For a ______ index, the weight of an indexed field denotes the significance of the field relative to the other indexed fields in terms of the score.

A. unique
B. natural
C. text
D. all of the mentioned
Answer» C. text
14.

You may not specify a unique constraint on a ______ index.

A. Hashed
B. Unique
C. Sparse
D. Compound
Answer» B. Unique
15.

To force MongoDB to use a particular index for a db.collection.________ operation, specify the index with the hint() method.

A. query()
B. find()
C. index()
D. all of the mentioned
Answer» C. index()
16.

The __________ operator constrains the results of a geospatial $near or $nearSphere query to the specified distance.

A. $center
B. $maxDistance
C. $minDistance
D. all of the mentioned
Answer» C. $minDistance
17.

Which of the following indexes are always sparse ?

A. 2dsphere
B. 2d
C. geoHaystack
D. all of the mentioned
Answer» E.
18.

Specify the ______ operator to the hint() method to prevent MongoDB from using any index

A. $unique
B. $natural
C. $spatial
D. all of the mentioned
Answer» C. $spatial
19.

The $geoWithin operator uses the _______ operator to specify the GeoJSON object.

A. $sphere
B. $geoin
C. $geometry
D. All of the mentioned
Answer» D. All of the mentioned
20.

If the specified polygon is _______ than a single hemisphere, the behavior of $geoWithin with the MongoDB CRS is the same as with the default CRS

A. smaller
B. bigger
C. equal
D. all of the mentioned
Answer» B. bigger
21.

When used with the _____ operator, $geoWithin returns documents based on grid coordinates and does not query for GeoJSON shapes.

A. $box
B. $circle
C. $shape
D. All of the mentioned
Answer» B. $circle
22.

$geoWithin replaces _______ in MongoDB 2.4.

A. $withing
B. $gwithin
C. $within
D. All of the mentioned
Answer» D. All of the mentioned
23.

To query with a single-ringed GeoJSON polygon whose area is greater than a single hemisphere, the $geometry expression must specify the custom MongoDB ________

A. CRS
B. CDS
C. CLS
D. None of the mentioned
Answer» B. CDS
24.

________ is the ability of a query to narrow results using the index.

A. Causality
B. Cardinality
C. Selectivity
D. All of the mentioned
Answer» C. Selectivity
25.

________ returns a document only once for a geospatial query even if the document matches the query multiple times.

A. $uniqueDocs
B. $unique
C. $Docs
D. All of the mentioned
Answer» B. $unique
26.

_________ specifies a polygon for a geospatial $geoWithin query on legacy coordinate pairs.

A. $rect
B. $polygon
C. $poly
D. All of the mentioned
Answer» C. $poly
27.

To avoid creating an index with a name that exceeds the index name length limit, you can pass the _____ option to the db.collection.createIndex() method.

A. name
B. lang
C. number
D. all of the mentioned
Answer» B. lang
28.

Indexes do not have to fit entirely into ______ in all cases.

A. ROM
B. RAM
C. Secondary Storage
D. None of the mentioned
Answer» B. RAM
29.

Only the ______ geospatial index supports the $polygon operator

A. 1dsphere
B. 2d
C. 3d
D. None of the mentioned
Answer» C. 3d