MongoDB 8 · Create, read, update, delete
Sort and paginate
Return the 10 newest documents, skipping the first 20.
db.users.find().sort({ createdAt: -1 }).skip(20).limit(10)
Official MongoDB 8 documentation
More create, read, update, delete commands
- Insert a document
- Insert several documents
- Find all documents
- Find with a filter and projection
- Find one document
- Count matching documents
All create, read, update, delete commands · MongoDB 8 cheatsheet