Skip to content

Commit d9b266f

Browse files
authored
DOCSP-47041: Causal consistency (#623)
* DOCSP-47041: Causal consistency * edit * wording * table * typo * JS feedback * remove file * sharedinclude
1 parent 32eb1c3 commit d9b266f

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

source/crud/transactions.txt

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,10 @@ error, the driver cancels the transaction and discards all data changes
2828
before they ever become visible.
2929

3030
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.
3935

4036
When using the {+driver-short+}, you can create a new session from a
4137
``MongoClient`` instance as a ``ClientSession`` type. We recommend that you reuse
@@ -54,6 +50,35 @@ instantiating a new client each time.
5450
You must include the ``session`` as a parameter for any operations that you
5551
want to include in a transaction.
5652

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+
5782
Methods
5883
-------
5984

0 commit comments

Comments
 (0)