1.Single-document atomicity
A write to one document — even one that touches several nested fields and array elements at once — is always all-or-nothing. No other operation ever sees the document half-updated, and multi-document transactions exist for exactly the cases this guarantee does not cover.
Key features
- A single updateOne/updateMany/findOneAndUpdate call is atomic per document it touches
- This holds even when the update modifies multiple fields, nested subdocuments, and array elements in one call
- No reader ever observes a document mid-update — a read sees either the fully-old or fully-new version
- This guarantee does NOT extend across two separate write calls to the same document — those are two atomic operations, not one
- It does NOT extend across two different documents — that is what multi-document transactions are for
Command
// One update call to one document = atomic. Two calls, or two documents = not, without a transaction.One write call to one document is always atomic, however many fields it touches — but two separate calls are two atomic operations, not one, even against the same document.