Kinds of Indexes
Kinds of Indexes: Compound Indexes and the Order of Fields, Unique and Text Indexes.
Updated
- Compound Indexes and the Order of Fields (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.
- 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.