diff --git a/source/crud/transactions.txt b/source/crud/transactions.txt index 102804b1d..f9c533412 100644 --- a/source/crud/transactions.txt +++ b/source/crud/transactions.txt @@ -28,14 +28,10 @@ error, the driver cancels the transaction and discards all data changes before they ever become visible. In MongoDB, transactions run within logical **sessions**. A -:manual:`session ` is a grouping of related -read or write operations that you intend to run sequentially. Sessions -enable :manual:`causal consistency -` for a -group of operations or allow you to execute operations in an -:website:`ACID transaction `. MongoDB -guarantees that the data involved in your transaction operations remains -consistent, even if the operations encounter unexpected errors. +session is a grouping of related read or write operations that you +intend to run sequentially. Sessions allow you to run operations +in an ACID-compliant transaction, which is a transaction that meets +an expectation of atomicity, consistency, isolation, and durability. When using the {+driver-short+}, you can create a new session from a ``MongoClient`` instance as a ``ClientSession`` type. We recommend that you reuse @@ -54,6 +50,35 @@ instantiating a new client each time. You must include the ``session`` as a parameter for any operations that you want to include in a transaction. +Causal Consistency +~~~~~~~~~~~~~~~~~~ + +.. sharedinclude:: dbx/causal-consistency.rst + + .. replacement:: insert-one-method + + ``insertOne()`` + + .. replacement:: update-one-method + + ``updateOne()`` + + .. replacement:: find-one-method + + ``find()`` + + .. replacement:: delete-one-method + + ``deleteOne()`` + + .. replacement:: majority-rc + + ``MAJORITY`` + + .. replacement:: majority-wc + + ``MAJORITY`` + Methods -------