Transactions (1/2)
What Are Transactions in MongoDB?
    Transactions in MongoDB allow you to perform multiple operations across one or more documents (and collections) as a single, atomic unit. This means that all the operations in a transaction are either fully completed (committed) or fully undone (rolled back) if an error occurs.
    Key Features of Transactions:
    • Atomicity: Ensures that all operations within a transaction are applied as a single unit.
    • Consistency: Maintains data consistency by ensuring that changes made during a transaction do not leave the database in an inconsistent state.
    • Isolation: Guarantees that ongoing transactions do not interfere with each other