One of the powerful features of MongoDB is indexing and its wide and rich indexing functionality. the database index is a data structure that mainly improves the speed of data fetching operations.
Indexing is used for search query sort its boost up performance without index collection will be scanned fully to get required data so it’s a very slow operation for the big amount of data that’s why indexing can increase read query and get only required data instead of full data. MongoDB has by default indexing on the _id field.
Mongo uses B-tree data structure. B-tree is a tree data structure that keeps data sorted and balanced. B-tree is optimized for systems that read and write large blocks of data.
Types of indexes –
- Compound index
- Single field index
- Multi-key index
- Geo index
- Hashed key index
- Covered index
In next blog, I will tell you how to use indexing to get Millions/Billions of amount data and also how to create indexes.
Keep reading blog on Technoalerts for more useful stuff in programming.