Isolation in transactions

What is Snaphot Isolation in the context of transactions in Mongo DB

Hi @Adhiraj_Kinlekar,

Snapshot isolation refers to transactions seeing a consistent view of data: transactions can read data from a “snapshot” of data committed at the time the transaction starts. Any conflicting updates will cause the transaction to abort.

MongoDB transactions support a transaction-level read concern and transaction-level write concern. Clients can set an appropriate level of read & write concern, with the most rigorous being snapshot read concern combined with majority write concern.


@Stennie Thank you for your response. If i understood you right, after my transaction creates a snapshot, if there have been writes to the document that i am trying to write to then it will create write conflicts?

Eg 1. User A started a tranasaction and a snapshot has been created.
2. User B writes to a document with _id of 1234
3. This leads to User A seeing seeing old data for document with _id of 1234(Because of snapshot)
4. This leads to a write conflict for User A when he tries to write to the document with _id of 1234