@@ -53,61 +53,32 @@ instantiating a new client each time.
53
53
Causal Consistency
54
54
~~~~~~~~~~~~~~~~~~
55
55
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
63
57
64
- The following table describes the guarantees that causally
65
- consistent sessions provide:
58
+ .. replacement:: insert-one-method
66
59
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()``
80
61
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
84
63
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()``
88
65
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
92
67
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()``
96
69
97
- In a causally consistent session, MongoDB ensures a
98
- causal relationship between the following operations:
70
+ .. replacement:: delete-one-method
99
71
100
- - Read operations that have a ``MAJORITY`` read concern
101
- - Write operations that have a ``MAJORITY`` write concern
72
+ ``deleteOne()``
102
73
103
- .. tip::
74
+ .. replacement:: majority-rc
104
75
105
- To learn more about the concepts mentioned in this section, see the
106
- following {+mdb-server+} manual entries:
76
+ ``MAJORITY``
107
77
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
110
79
80
+ ``MAJORITY``
81
+
111
82
Methods
112
83
-------
113
84
0 commit comments