$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.

CategoryCore Stages
MongoDB Version1.0+
Example Languagemongosh (Shell)

📝 Syntax

{ $skip: <positive integer> }

⚙️ Parameters

skip countNumber 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

📚 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.
Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏