C100DEV Indexing Practice Question
Which index type should be used to support efficient queries on a field containing geographical coordinates in MongoDB?
⚠ Common exam trap
Candidates often confuse 2d indexes with 2dsphere indexes, failing to realize that 2dsphere is required for accurate spherical calculations on Earth-based coordinate data.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
2dsphere index
The 2dsphere index is specifically designed to support queries on geospatial data using spherical geometry. This index type is essential for location-based applications that perform proximity searches or geometry intersections. By structuring data this way, MongoDB can optimize calculations for distances between points on a sphere, which is crucial for modern mapping and delivery applications that require high precision and performance over large datasets.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Text index
Why it's wrong here
Text indexes are designed for searching string content and performing full-text search operations. They do not support geospatial operators like $near or $geoWithin, which require specialized structures to calculate distances on a curved surface efficiently and accurately for location-based data points within a database collection.
- ✗
Hashed index
Why it's wrong here
Hashed indexes provide efficient equality matches by hashing the value of a field. They do not support range-based queries or geospatial calculations. Using a hashed index for coordinates would prevent the database from utilizing proximity-based query operators required for location-aware applications, leading to full collection scans.
- ✓
2dsphere index
Why this is correct
The 2dsphere index supports queries that interpret data as points on an earth-like sphere. It is the primary index type for geolocation data, enabling operations like $nearSphere, $geoWithin, and $geoIntersects, which are necessary for calculating distances and boundaries between various geographic coordinates efficiently.
- ✗
Compound index
Why it's wrong here
While compound indexes allow indexing multiple fields, they do not inherently provide the geospatial math capabilities required for coordinates. You would need to include a 2dsphere index within a compound structure to achieve geospatial functionality, making this option less specific and accurate than the required index type.
About these practice questions
One of 259 original C100DEV practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official MongoDB exam blueprint
This C100DEV practice question is part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the C100DEV exam.