# Kinds of Indexes

Kinds of Indexes: Compound Indexes and the Order of Fields, Unique and Text Indexes.

Updated: November 19, 2026

1. [Compound Indexes and the Order of Fields](https://www.ask-codey.com/lessons/mongodb-compound-indexes) (Journeyman): A compound index keeps its entries in order by one field and then by the next, so a single index can serve a filter and a sort together, and the order of its fields (equal, then sort, then range) decides how much of it MongoDB has to read.
2. [Unique and Text Indexes](https://www.ask-codey.com/lessons/mongodb-unique-and-text-indexes) (Journeyman): A unique index makes MongoDB refuse a second document with the same value, such as a customer's email, with a duplicate key error, and a text index lets a search box find products by the words in their names and descriptions with $text.

Source: https://www.ask-codey.com/courses/mongodb-in-depth/topics/mongodb-kinds-of-indexes
