Navigation
This version of the documentation is archived and no longer supported.
Indexing Reference
Indexing Methods in the mongo
Shell
Indexing Database Commands
Name |
Description |
dropIndexes |
Removes indexes from a collection. |
compact |
Defragments a collection and rebuilds the indexes. |
reIndex |
Rebuilds all indexes on a collection. |
validate |
Internal command that scans for a collection’s data and indexes for correctness. |
indexStats |
Experimental command that collects and aggregates statistics on all indexes. |
geoNear |
Performs a geospatial query that returns the documents closest to a given point. |
geoSearch |
Performs a geospatial query that uses MongoDB’s haystack index functionality. |
geoWalk |
An internal command to support geospatial queries. |
checkShardingIndex |
Internal command that validates index on shard key. |
Geospatial Query Selectors
Name |
Description |
$geoWithin |
Selects geometries within a bounding GeoJSON geometry. |
$geoIntersects |
Selects geometries that intersect with a GeoJSON geometry. |
$near |
Returns geospatial objects in proximity to a point. |
$nearSphere |
Returns geospatial objects in proximity to a point on a sphere. |
Indexing Query Modifiers
Name |
Description |
$explain |
Forces MongoDB to report on query execution plans. See explain() . |
$hint |
Forces MongoDB to use a specific index. See hint() |
$max |
Specifies an exclusive upper limit for the index to use in a query. See max() . |
$min |
Specifies an inclusive lower limit for the index to use in a query. See min() . |
$returnKey |
Forces the cursor to only return fields included in the index. |
$snapshot |
Forces the query to use the index on the _id field. See snapshot() . |