Introduction
Transactions help keep data safe and correct when many changes happen together. Sometimes you need them, sometimes you don't.
When you need to update multiple documents and all must succeed or fail together, like transferring money between accounts.
When you want to make sure data stays consistent after several related changes.
When your operation involves multiple collections and you want to avoid partial updates.
When you want to prevent errors from leaving your database in a broken state.
When you need to rollback changes if something goes wrong during a set of operations.