MongoDB Indexes

This section introduces you to MongoDB indexes that help perform queries faster and more efficiently. After completing the tutorials in this section, you’ll have a good understanding of indexes and how to use them more effectively. You’ll understand the following key topics:

  • What indexes are and why you need to use them.
  • How to select fields to index.
  • Understand various types of indexes in MongoDB.
  • How to evaluate the index usage.
  • How to manage indexes such as creating and removing them.

Indexes are an important part of your application. And you’ll see that selecting the right indexes for your collections is crucial to performance.

  • Create indexes – introduce you to the index concept and show you how to use the createIndex() method to create an index for a field of a collection.
  • Drop indexes – learn how to drop an index from a collection.
  • Compound indexes – learn the compound indexes that contain references to multiple fields of a collection.
  • Unique indexes – show you how to use unique indexes to enforce the uniqueness of values in a field across documents of a collection.
Was this tutorial helpful ?