The $set operator changes only the named fields; without it, MongoDB replaces the entire document. updateMany applies the change to every match. Related: replaceOne for full replacement.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.