$skip (Skip)
Last updated: 2026-10-09
$skip (Skip)
$skip drops the first N documents in the pipeline's current order and passes the rest unchanged. It is typically paired with $limit for offset pagination. Skipping is not free — skipped documents are still read and discarded. For large datasets, prefer range queries on a sort key over deep pagination.
| Category | Core Stages |
|---|---|
| MongoDB Version | 1.0+ |
| Example Language | mongosh (Shell) |
📝 Syntax
{ $skip: <positive integer> }
⚙️ Parameters
| skip count | Number of documents to drop; must be a non-negative integer. |
|---|
Returns:Document stream after dropping the first N documents
▶ Example
Run the commands below in your local mongosh (requires a running mongod):
// $skip: page 2, 10 per page
db.articles.aggregate([
{ $sort: { date: -1 } },
{ $skip: 10 },
{ $limit: 10 }
])
Output:
// Articles 11-20 by date descending
📌 Notes
- $skip does not change document order
- Large offsets are slow; fine for small datasets
- For deep pagination, switch to a $match range query on the sort key
🏷️ Related Tags
💡 Related Cases
Introduction to Aggregate Pipelines: The `aggregate` Method and the Basic Stage
$facet + $bucket + Text/Geospatial Search
📚 Related Tutorials
❓ FAQ
QDoes $skip use an index?
ANot directly. Skipped documents are still read and thrown away.
QAre there performance issues with $skip pagination?
AYes. Deeper pages skip more documents; use range queries on a sort key for large datasets.
QCan $skip take 0?
AYes, 0 skips nothing — effectively a no-op.