What are the different indexing types in MongoDB?
devDoctor
Last updated on
Your thoughts?
Share your thoughts
- single field
- compound
- geoSpatial
- 2d
- 2dsphere
- hashed
- text
Additionally you have following options...
- unique
- sparse
- partial
- hidden
single and compound
- single field
- compound
- hashed
- geospatial (2d, 2dsphere)
Single Field Index
Compound index
Multikey index (automatically generated if field is an array)
Text Index
Wildcard Index
2dsphere Index
2d Index
Hashed Index
For examples and when to use what, check out Indexing Types in MongoDB.