File tree Expand file tree Collapse file tree 8 files changed +30
-9
lines changed Expand file tree Collapse file tree 8 files changed +30
-9
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,13 @@ Definition
23
23
without saving any of the changes made by the operations in the
24
24
transaction.
25
25
26
+ .. |method| replace:: :method:`Session.abortTransaction`
27
+ helper method
28
+ .. include:: /includes/fact-dbcommand-tip
29
+
26
30
To run the :dbcommand:`abortTransaction`, the command must be run
27
31
against the ``admin`` database and run within a
28
- :method:`Session`. Rather than run the :dbcommand:`abortTransaction`
29
- command directly, most users should use the driver method or the
30
- :binary:`~bin.mongosh` :method:`Session.abortTransaction()`
31
- helper.
32
+ :method:`Session`.
32
33
33
34
Syntax
34
35
------
Original file line number Diff line number Diff line change @@ -20,12 +20,14 @@ Definition
20
20
Saves the changes made by the operations in the :doc:`multi-document
21
21
transaction </core/transactions>` and ends the transaction.
22
22
23
+ .. |method| replace:: :method:`Session.commitTransaction` and
24
+ :method:`Session.withTransaction`
25
+ helper methods
26
+ .. include:: /includes/fact-dbcommand-tip
27
+
23
28
To run the :dbcommand:`commitTransaction`, the command must be run
24
29
against the ``admin`` database and run within a
25
- :method:`Session`. Rather than run the :dbcommand:`commitTransaction`
26
- command directly, most users should use the driver method or the
27
- :binary:`~bin.mongosh` :method:`Session.commitTransaction()`
28
- helper.
30
+ :method:`Session`.
29
31
30
32
Syntax
31
33
------
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ Definition
18
18
The :dbcommand:`startSession` command starts a new logical
19
19
:ref:`session <sessions>` for a sequence of operations.
20
20
21
+
22
+ .. |method| replace:: :method:`Mongo.startSession`
23
+ helper method
24
+ .. include:: /includes/fact-dbcommand-tip
25
+
21
26
Syntax
22
27
------
23
28
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ Definition
19
19
:binary:`~bin.mongosh` assigns the session ID to commands associated
20
20
with the session.
21
21
22
+ .. |dbcommand| replace:: :dbcommand:`startSession` command
23
+ .. include:: /includes/fact-mongosh-shell-method-alt
24
+
22
25
The :method:`~Mongo.startSession()` method can take a document with
23
26
session options. The options available are:
24
27
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ Definition
21
21
without saving any of the changes made by the operations in the
22
22
transaction.
23
23
24
+ .. |dbcommand| replace:: :dbcommand:`abortTransaction` command
25
+ .. include:: /includes/fact-mongosh-shell-method-alt
26
+
24
27
.. include:: /includes/transaction-support
25
28
26
29
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ Definition
18
18
Saves the changes made by the operations in the :doc:`multi-document
19
19
transaction </core/transactions>` and ends the transaction.
20
20
21
+ .. |dbcommand| replace:: :dbcommand:`commitTransaction` command
22
+ .. include:: /includes/fact-mongosh-shell-method-alt
23
+
21
24
.. include:: /includes/transaction-support
22
25
23
26
Original file line number Diff line number Diff line change @@ -101,3 +101,4 @@ method to retrieve the database object associated with the session.
101
101
/reference/method/Session.abortTransaction
102
102
/reference/method/Session.commitTransaction
103
103
/reference/method/Session.startTransaction
104
+ /reference/method/Session.withTransaction
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ Definition
25
25
- commit operation, if there is a failure to commit.
26
26
- entire transaction, if the error permits.
27
27
28
+ .. |dbcommand| replace:: :dbcommand:`commitTransaction` command
29
+ .. include:: /includes/fact-mongosh-shell-method-alt
30
+
28
31
The :method:`Session.withTransaction()` method accepts the
29
32
`transaction options
30
33
<https://mongodb.github.io/node-mongodb-native/4.8/interfaces/TransactionOptions.html>`__.
@@ -33,7 +36,7 @@ Definition
33
36
Behavior
34
37
--------
35
38
36
- The Node.js driver has a version of ``Session.withTransaction()` that is
39
+ The Node.js driver has a version of ``Session.withTransaction()`` that is
37
40
known as the `Callback API
38
41
<https://www.mongodb.com/docs/drivers/node/current/fundamentals/transactions/#callback-api>`__.
39
42
The ``Callback API`` also accepts an callback, however the return type
You can’t perform that action at this time.
0 commit comments