Make multiple MongoDB changes behave like one operation when all of them need to succeed together.
MongoDB supports transactions when an operation needs multiple changes to succeed or fail as one unit. This is useful when updating several documents or collections where leaving only some changes applied could make the application's data inconsistent.
Transactions provide stronger consistency guarantees, but they also add overhead and should not automatically be used for every operation. Good MongoDB design often reduces the need for transactions by modelling related data together when appropriate.
What you'll walk away knowing