From 80d610428e59192a4953705e14820c470584b013 Mon Sep 17 00:00:00 2001 From: Angela Date: Tue, 25 Mar 2025 11:50:15 -0400 Subject: [PATCH 1/2] add casual consistency section: --- source/crud/transactions.txt | 43 ++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/source/crud/transactions.txt b/source/crud/transactions.txt index 4349208aa..8ecda4c38 100644 --- a/source/crud/transactions.txt +++ b/source/crud/transactions.txt @@ -47,18 +47,6 @@ ACID transactions `. Operations ` section in the Server manual. -In MongoDB, multi-document transactions run within a **client session**. -A client session is a grouping of related read or write operations that -you want to execute sequentially. We recommend you reuse -your client for multiple sessions and transactions instead of -instantiating a new client each time. - -When combined with ``majority`` read and -write concerns, the driver guarantees causal consistency between the -operations. To learn more, see :manual:`Client Sessions and Causal Consistency Guarantees -` in the -Server manual. - Learn more about how to use the driver to perform multi-document transactions in the following sections of this guide: @@ -66,6 +54,37 @@ transactions in the following sections of this guide: - :ref:`Transaction Options ` - :ref:`Transaction Errors ` +.. _nodejs-causal-consistency: + +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`` + .. _nodejs-transaction-apis: Transaction APIs From dfb46258b3ae6e99a87459ea337680dc942bdf3c Mon Sep 17 00:00:00 2001 From: Angela Date: Tue, 25 Mar 2025 13:42:02 -0400 Subject: [PATCH 2/2] change find to findone --- source/crud/transactions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/crud/transactions.txt b/source/crud/transactions.txt index 8ecda4c38..d6c238d65 100644 --- a/source/crud/transactions.txt +++ b/source/crud/transactions.txt @@ -71,7 +71,7 @@ Causal Consistency .. replacement:: find-one-method - ``find()`` + ``findOne()`` .. replacement:: delete-one-method