- April 30, 2020
MongoDB supoort different types of indexes such as Single Field Indexes, Compound Indexes, Multikey Indexes, Text Indexes, Wildcard Indexes, 2dsphere Indexes, 2d Indexes, geoHaystack Indexes, Hashed Indexes, and default _id index.
Indexes support the efficient execution of queries in MongoDB queries. Without indexes, MongoDB must perform a collection scan, i.e. scan every document in a collection. Any query if you dont use an index means that full scan occurs on collection. If an appropriate index exists for a query, MongoDB can use the index to limit the number of documents it must inspect.
The best approach...