How to use indexes properly in MongoDB
Boost your MongoDB queries by indexes
An issue we often ignore in MongoDB is the indexes. We may take for granted that MongoDB works like Elasticsearch and all fields are indexed by default. Actually, this is not true! In MongoDB, only the _id
field is automatically indexed and we need to build indexes for the fields that are queried frequently to support the queries efficiently. Otherwise, the queries can be very inefficient and will degrade the performance of the MongoDB server.