MutationsUpdates, Upserts & Deletes
All courses

Changing data (carefully)

$set, $inc, $push, $pull — update operators for surgical edits.

Quirk — upsert: { upsert: true } creates a document if the filter matches nothing. Great for idempotent writes. Also great for accidental duplicate collections if your filter is wrong.

Output
Press Run to execute your code.