Introduction
Sessions and transactions help you group multiple database actions so they happen together or not at all. This keeps your data safe and correct.
When you want to update several documents and ensure all updates succeed or none do.
When transferring money between two accounts and you need both debit and credit to happen together.
When inserting related data in multiple collections and want to avoid partial data.
When you want to keep your database consistent during complex operations.
When you want to retry operations safely if something goes wrong.