MongoDB 8 · Create, read, update, delete
Update many documents
Increase a counter on every matching document.
db.users.updateMany({ active: true }, { $inc: { logins: 1 } })
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
- Sort and paginate
All create, read, update, delete commands · MongoDB 8 cheatsheet