Skip to content
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()``
Comment thread
nbbeeken marked this conversation as resolved.

.. replacement:: delete-one-method

``deleteOne()``

.. replacement:: majority-rc

``majority``

.. replacement:: majority-wc

``majority``

.. _nodejs-transaction-apis:

Transaction APIs
Expand Down