Skip to content

DOCSP-48501 add casual consistency section #1047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions source/crud/transactions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,44 @@ ACID transactions </basics/acid-transactions>`.
Operations </core/transactions/#transactions-and-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
</core/read-isolation-consistency-recency/#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:

- :ref:`Transaction APIs <nodejs-transaction-apis>`
- :ref:`Transaction Options <nodejs-transaction-settings>`
- :ref:`Transaction Errors <nodejs-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

``findOne()``

.. replacement:: delete-one-method

``deleteOne()``

.. replacement:: majority-rc

``majority``

.. replacement:: majority-wc

``majority``

.. _nodejs-transaction-apis:

Transaction APIs
Expand Down
Loading