MongoDB 8 · Create, read, update, delete

Update a document

Set fields on the first matching document.

db.users.updateOne({ email: "[email protected]" }, { $set: { age: 37 } })

Official MongoDB 8 documentation

More create, read, update, delete commands

All create, read, update, delete commands · MongoDB 8 cheatsheet

Was this page helpful?