skip()
Reference group: Cursor methods
What it does
Skips the first N results.
Syntax
cursor.skip(n)
Use case
Simple offset pagination.
Important notes
Large offsets can be expensive; consider range pagination.
skip(): practical example
db.products.find({ active: true }).sort({ _id: 1 }).skip(100).limit(20)💡 Explanation
Skips the first N results.
When to use it
Simple offset pagination.
Caution
Large offsets can be expensive; consider range pagination.
Key Takeaways
- Skips the first N results.
- Typical use: Simple offset pagination.