Home
MCQS
MongoDB MCQ Quiz Hub
MongoDB Mcq Question Set 13
Choose a topic to test your knowledge and improve your MongoDB skills
1. Point out the correct statement.
If an appropriate index exists for a query, MongoDB cannot use the index to limit the number of documents it must inspect
Indexes support the efficient execution of queries in MongoDB
The index stores the location of a specific field or set of fields, ordered by the value of the field
None of the mentioned
2. MongoDB supports the creation of user-defined ascending/descending indexes on a ______ field of a document.
Single
Non Unique
Compound
none of the mentioned
3. The ______ index is unique and prevents clients from inserting two documents with the same value for the _id field.
_id
$default
_def
None of the mentioned
4. Point out the wrong statement.
MongoDB can return sorted results by using the ordering in the index
MongoDB defines indexes at the collection level and supports indexes on any field or sub-field of the documents in a MongoDB collection
Fundamentally, indexes in MongoDB is different to indexes in other database systems
None of the mentioned
5. MongoDB also supports user-defined indexes on multiple fields called ___
compound
composite
candidate
None of the mentioned
6. MongoDB uses ______ indexes to index the content stored in arrays.
singlekey
multikey
compkey
None of the mentioned
7. ______ indexes use spherical geometry to return results.
3dsphere
2dsphere
1dsphere
none of the mentioned
8. MongoDB provides a ________ index type that supports searching for string content in a collection.
string
text
char
None of the mentioned
9. _____ indexes uses planar geometry when returning results.
2d
1d
3d
All of the mentioned
10. To support ________ based sharding, MongoDB provides a hashed index type.
primary
root
hash
All of the Mentioned
11. Point out the correct statement.
Whether the use of a compound index or the use of an index intersection is more efficient depends on the particular query and the system
Certain restrictions apply to indexes, such as the length of the index keys or the number of indexes per collection
For queries that specify compound query conditions, if one index can fulfill a part of a query condition, and another index can fulfill another part of the query condition, then MongoDB can use the i
None of the mentioned
12. _______ index type, which indexes the hash of the value of a field.
Hashed
Unique
Multikey
None of the mentioned
13. The _________ property for an index causes MongoDB to reject duplicate values for the indexed field.
Hashed
Unique
Multikey
None of the mentioned
14. Point out the wrong statement.
TTL index is ideal for certain types of information like machine generated event data, logs, and session information that only need to persist in a database for a finite amount of time
You cannot combine the sparse index option with the unique index option
TTL indexes are special indexes that MongoDB can use to automatically remove documents from a collection after a certain amount of time
none of the mentioned
15. The ______ property of an index ensures that the index only contain entries for documents that have the indexed field.
Hashed
Unique
Sparse
None of the mentioned
16. MongoDB can use the _________ of indexes to fulfill queries.
union
intersection
projection
None of the mentioned
17. Which of the following method is to verify whether MongoDB used index intersection?
explain()
analyze()
intersect()
None of the mentioned
18. An index prefix is a subset of a ______ index, consisting of one or more keys starting from the beginning of the index.
Hashed
Unique
Sparse
Compound
19. Index __________ does not eliminate the need for creating compound indexes.
union
addition
intersection
All of the Mentioned
20. Before version _______ capped collections did not have an _id field.
2.1
2.4
3.0
2.2
21. Point out the wrong statement.
You can create indexes on fields within embedded documents
Indexes on embedded fields are similar to indexes on embedded documents
Indexes on embedded fields allow you to use a “dot notation,” to introspect into embedded documents
None of the mentioned
22. For a _____ multikey index, each indexed document can have at most one indexed field whose value is an array.
Hashed
Unique
Multikey
compound
23. Which of the following indexes cannot be multikey?
Hashed
Unique
Multikey
compound
24. Point out the wrong statement.
You may not create compound indexes that have hashed index fields
The order of the fields in a compound index is very important
You will receive a warning if you attempt to create a compound index that includes a hashed index
none of the mentioned
25. To calculate geometry over an Earth-like sphere, store your location data on a spherical surface and use _____ index.
2dsphere
2d
geoHaystack
All of the Mentioned
26. _____ indexes can be constructed over arrays that hold both scalar values (e.g. strings, numbers) and nested documents.
Hashed
Unique
Multikey
compound
27. The coordinate reference system for GeoJSON uses the _____ datum.
WGS88
WGS84
JGS88
none of the mentioned
28. Which of the following is used to calculate distances on a Euclidean plane?
2dsph
2d
geoHaystack
All of the Mentioned
29. Queries on ________ objects always calculate on a sphere.
GeoBSON
GeoJSON
geoJSONB
All of the Mentioned
30. Which of the following GeoJSON object is not supported in MongoDB?
Point
LineString
MultiPoint
None of the mentioned
31. Point out the wrong statement.
MongoDB can query for locations contained entirely within a specified polygon
MongoDB require an index for inclusion queries; however, such indexes will improve query performance
Indexes on embedded fields allow you to use a “dot notation,” to introspect into embedded documents
none of the mentioned
32. MongoDB supports spherical surface calculations on legacy coordinate pairs using a _______ index.
2dsphere
2d
geoHaystack
All of the Mentioned
33. Inclusion queries use the _________ operator in MongoDB.
$geokey
$geoin
$geoWithin
All of the mentioned
34. Point out the correct statement.
For $geoSphere queries that specify GeoJSON geometries with areas greater than a single hemisphere, the use of the default CRS results in queries for the complementary geometries
When determining inclusion, MongoDB considers the border of a shape to be part of the shape, subject to the precision of floating point numbers
The custom MongoDB CRS uses a anti-clockwise winding order
None of the mentioned
35. The $geoWithin operator uses the _______ operator to specify the GeoJSON object.
$sphere
$geoin
$geometry
All of the Mentioned
36. 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.
smaller
bigger
equal
All of the Mentioned
37. To query with a single-ringed GeoJSON polygon whose area is greater than a single hemisphere, the $geometry expression must specify the custom MongoDB ________
CRS
CDS
CLS
None of the mentioned
38. $geoWithin replaces _______ in MongoDB 2.4.
$withing
$gwithin
$within
All of the Mentioned
39. When used with the _____ operator, $geoWithin returns documents based on grid coordinates and does not query for GeoJSON shapes.
$box
$circle
$shape
All of the mentioned
40. _____ indexes expire documents after the specified number of seconds has passed since the indexed field value.
Hashed
Unique
Multikey
TTL
41. Point out the correct statement.
If you build a TTL index in the foreground, MongoDB does not remove expired documents as soon as the index finishes building
The TTL index does guarantee that expired data will be deleted immediately upon expiration
Duration of the removal operation depends on the workload of your mongod instance
None of the mentioned
42. The background task that removes expired documents runs every ________ seconds.
15
45
60
120
43. Point out the wrong statement.
The unique constraint applies to separate documents in the collection
Unique index prevents separate documents from having the same value for the indexed key
Index does prevent a document from having multiple elements or embedded documents in an indexed array from having the same value
none of the mentioned
44. On replica sets, the TTL background thread only deletes documents on _____
primary
secondary
upadte
none of the mentioned
45. You can combine the ________ constraint with the sparse index to filter these null values from the unique index and avoid the error.
Hashed
Unique
Sparse
Compound
46. You may not specify a unique constraint on a ______ index.
Hashed
Unique
Sparse
compound
47. Which of the following indexes are always sparse?
2dsphere
2d
geoHaystack
All of the mentioned
48. To modify an existing index, you cannot just re-issue the _________ method with the updated specification of the index.
dropIndex()
modIndex()
createIndex()
None of the mentioned
49. Point out the wrong statement.
To modify an existing index, you need to drop and recreate the index
Your client library may have a different or additional interface for this operation
To see the status of an indexing process, you can use the db.statusOp() method in the mongo shell
None of the mentioned
50. If you need to rebuild indexes for a collection you can use the _________ method to rebuild all indexes on a collection in a single operation.
db.collection.Index()
db.collection.reIndex()
db.collection.rebuildIndex()
None of the mentioned
51. To terminate an ongoing index build, use the __________ method in the mongo shell.
db.currentOp()
db.killOp()
db.removeOp()
All of the mentioned
52. Point out the correct statement.
After 4.0, you cannot terminate both background index builds and foreground index builds
Before MongoDB 2.1, you could only terminate background index builds
After 2.4, you can terminate both background index builds and foreground index builds
None of the mentioned
53. In the mongo shell, you can use the ______ method to return a list of the indexes on a collection.
getallIndexes()
getretIndexes()
getIndexes()
none of the mentioned
54. ____ views partial execution statistics collected during plan selection.
curs.explain()
cursor.explain()
cursr.explain()
All of the Mentioned
55. The __________ operator constrains the results of a geospatial $near or $nearSphere query to the specified distance.
$center
$maxDistance
$minDistance
All of the mentioned
56. To force MongoDB to use a particular index for a db.collection.________ operation, specify the index with the hint() method.
query()
find()
index()
All of the mentioned
57. Specify the ______ operator to the hint() method to prevent MongoDB from using any index.
$unique
$natural
$spatial
All of the Mentioned
58. ______ selects geometries that intersect with a GeoJSON geometry.
$near
$nearsphere
$geoIntersect
None of the mentioned
59. Point out the wrong statement.
If $near or $nearSphere query specifies the center point as a GeoJSON point, specify the distance as a non-negative number in meters
If $nearSphere query specifies the center point as legacy coordinate pair, specify the distance as a non-negative number in radians
$near can only use the 2dsphere index if the query specifies the center point as a GeoJSON point
None of the mentioned
60. ______ returns geospatial objects in proximity to a point.
$near
$nearsphere
$geoIntersect
None of the mentioned
Submit