Skip to content

Commit 22f79b4

Browse files
committed
sharedinclude
1 parent ae6ae08 commit 22f79b4

File tree

1 file changed

+14
-43
lines changed

1 file changed

+14
-43
lines changed

source/crud/transactions.txt

Lines changed: 14 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -53,61 +53,32 @@ instantiating a new client each time.
5353
Causal Consistency
5454
~~~~~~~~~~~~~~~~~~
5555

56-
MongoDB enables **causal consistency** in client sessions.
57-
The causal consistency model guarantees that operations within a session
58-
run in a causal order. Clients observe results that are consistent
59-
with the causal relationships, or the dependencies between
60-
operations. For example, if you perform a series of operations where
61-
one operation logically depends on the result of another, any subsequent
62-
reads reflect the dependent relationship.
56+
.. sharedinclude:: dbx/causal-consistency.rst
6357

64-
The following table describes the guarantees that causally
65-
consistent sessions provide:
58+
.. replacement:: insert-one-method
6659

67-
.. list-table::
68-
:widths: 40 60
69-
:header-rows: 1
70-
71-
* - Guarantee
72-
- Description
73-
74-
* - Read your writes
75-
- Read operations reflect the results of preceding write operations.
76-
77-
* - Monotonic reads
78-
- Read operations do not return results that reflect an earlier data state than
79-
a preceding read operation.
60+
``insertOne()``
8061

81-
* - Monotonic writes
82-
- If a write operation must precede other write operations, the driver
83-
runs this write operation first.
62+
.. replacement:: update-one-method
8463

85-
For example, if you call ``insertOne()`` to insert a document, then call
86-
``updateOne()`` to modify the inserted document, the driver runs the
87-
insert operation first.
64+
``updateOne()``
8865

89-
* - Writes follow reads
90-
- If a write operation must follow other read operations, the driver runs
91-
the read operations first.
66+
.. replacement:: find-one-method
9267

93-
For example, if you call ``find()`` to retrieve a document, then call
94-
``deleteOne()`` to delete the retrieved document, the driver runs the find
95-
operation first.
68+
``find()``
9669

97-
In a causally consistent session, MongoDB ensures a
98-
causal relationship between the following operations:
70+
.. replacement:: delete-one-method
9971

100-
- Read operations that have a ``MAJORITY`` read concern
101-
- Write operations that have a ``MAJORITY`` write concern
72+
``deleteOne()``
10273

103-
.. tip::
74+
.. replacement:: majority-rc
10475

105-
To learn more about the concepts mentioned in this section, see the
106-
following {+mdb-server+} manual entries:
76+
``MAJORITY``
10777

108-
- :manual:`Causal Consistency </core/read-isolation-consistency-recency/#causal-consistency>`
109-
- :manual:`Causal Consistency and Read and Write Concerns </core/causal-consistency-read-write-concerns/>`
78+
.. replacement:: majority-wc
11079

80+
``MAJORITY``
81+
11182
Methods
11283
-------
11384

0 commit comments

Comments
 (0)