# Sorting and Paging: sort, limit and skip

sort puts results in order (1 up, -1 down) with a second field to break ties, limit caps how many come back, skip passes over the pages before, and countDocuments gives the number of pages.

![Cheat sheet: Sorting and Paging: sort, limit and skip](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/ed6e9be551cf4b8d92c82b4b01066f46.webp)

- Category: MongoDB
- Level: Apprentice
- Tags: countDocuments, Cursor (mongodb), mongodb, sort, limit and skip
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/mongodb-sorting-and-paging-cheat-sheet
