# Changing Documents with updateOne and $set

updateOne and updateMany change documents where they are, with a filter that picks the documents and an update operator that says what changes; $set writes fields, $unset removes them, and matchedCount and modifiedCount report what happened.

![Cheat sheet: Changing Documents with updateOne and $set](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/31a063885b134875851ec4c1d04521af.webp)

- Category: MongoDB
- Level: Apprentice
- Tags: mongodb, unset, Update Operators, updateMany, updateOne and $set
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/mongodb-updateone-and-set-cheat-sheet
