MongoDB 8 · Create, read, update, delete
Find with a filter and projection
Find users older than 30 and return only their names.
db.users.find({ age: { $gt: 30 } }, { name: 1, _id: 0 })
Official MongoDB 8 documentation
More create, read, update, delete commands
- Insert a document
- Insert several documents
- Find all documents
- Find one document
- Sort and paginate
- Count matching documents
All create, read, update, delete commands · MongoDB 8 cheatsheet