# Compound Indexes and the Order of Fields

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.

![Cheat sheet: Compound Indexes and the Order of Fields](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/3334b5f766654a9e8f1e042a5daf578b.webp)

- Category: MongoDB
- Level: Journeyman
- Tags: Compound Index, database, ESR Rule, Index Prefix, mongodb, sort, limit and skip
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/mongodb-compound-indexes-cheat-sheet
