@@ -28,14 +28,10 @@ error, the driver cancels the transaction and discards all data changes
28
28
before they ever become visible.
29
29
30
30
In MongoDB, transactions run within logical **sessions**. A
31
- :manual:`session </reference/server-sessions/>` is a grouping of related
32
- read or write operations that you intend to run sequentially. Sessions
33
- enable :manual:`causal consistency
34
- </core/read-isolation-consistency-recency/#causal-consistency>` for a
35
- group of operations or allow you to execute operations in an
36
- :website:`ACID transaction </basics/acid-transactions>`. MongoDB
37
- guarantees that the data involved in your transaction operations remains
38
- consistent, even if the operations encounter unexpected errors.
31
+ session is a grouping of related read or write operations that you
32
+ intend to run sequentially. Sessions allow you to run operations
33
+ in an ACID-compliant transaction, which is a transaction that meets
34
+ an expectation of atomicity, consistency, isolation, and durability.
39
35
40
36
When using the {+driver-short+}, you can create a new session from a
41
37
``MongoClient`` instance as a ``ClientSession`` type. We recommend that you reuse
@@ -54,6 +50,35 @@ instantiating a new client each time.
54
50
You must include the ``session`` as a parameter for any operations that you
55
51
want to include in a transaction.
56
52
53
+ Causal Consistency
54
+ ~~~~~~~~~~~~~~~~~~
55
+
56
+ .. sharedinclude:: dbx/causal-consistency.rst
57
+
58
+ .. replacement:: insert-one-method
59
+
60
+ ``insertOne()``
61
+
62
+ .. replacement:: update-one-method
63
+
64
+ ``updateOne()``
65
+
66
+ .. replacement:: find-one-method
67
+
68
+ ``find()``
69
+
70
+ .. replacement:: delete-one-method
71
+
72
+ ``deleteOne()``
73
+
74
+ .. replacement:: majority-rc
75
+
76
+ ``MAJORITY``
77
+
78
+ .. replacement:: majority-wc
79
+
80
+ ``MAJORITY``
81
+
57
82
Methods
58
83
-------
59
84
0 commit comments