Use a stable sort key such as `_id` or a timestamp.
Section: Projection, sort, and page
Cursor-style pagination idea
javascript
javascript
db.orders.find({ _id: { $lt: ObjectId("65f0c8d4d95f1b2a3c4d5e6f") } }).sort({ _id: -1 }).limit(20)Explanation
Cursor pagination usually scales better than repeated large skips.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Projection, sort, and page