Skip to content

Commit ee77942

Browse files
authored
DOCSP-27750 Interlinks Session methods (#2533) (#2597)
* DOCSP-27750 Interlinks Session methods * Adds Session.withTransaction to the toctree * Fixes rendering issue in Session.withTransaction * Test link fixes * Test link fixes * Test link fixes * Fixes per Anna Henningsen * Fixes per Anna Henningsen
1 parent 1e5bb0e commit ee77942

File tree

8 files changed

+30
-9
lines changed

8 files changed

+30
-9
lines changed

source/reference/command/abortTransaction.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ Definition
2323
without saving any of the changes made by the operations in the
2424
transaction.
2525

26+
.. |method| replace:: :method:`Session.abortTransaction`
27+
helper method
28+
.. include:: /includes/fact-dbcommand-tip
29+
2630
To run the :dbcommand:`abortTransaction`, the command must be run
2731
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`.
3233

3334
Syntax
3435
------

source/reference/command/commitTransaction.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ Definition
2020
Saves the changes made by the operations in the :doc:`multi-document
2121
transaction </core/transactions>` and ends the transaction.
2222

23+
.. |method| replace:: :method:`Session.commitTransaction` and
24+
:method:`Session.withTransaction`
25+
helper methods
26+
.. include:: /includes/fact-dbcommand-tip
27+
2328
To run the :dbcommand:`commitTransaction`, the command must be run
2429
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`.
2931

3032
Syntax
3133
------

source/reference/command/startSession.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ Definition
1818
The :dbcommand:`startSession` command starts a new logical
1919
:ref:`session <sessions>` for a sequence of operations.
2020

21+
22+
.. |method| replace:: :method:`Mongo.startSession`
23+
helper method
24+
.. include:: /includes/fact-dbcommand-tip
25+
2126
Syntax
2227
------
2328

source/reference/method/Mongo.startSession.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Definition
1919
:binary:`~bin.mongosh` assigns the session ID to commands associated
2020
with the session.
2121

22+
.. |dbcommand| replace:: :dbcommand:`startSession` command
23+
.. include:: /includes/fact-mongosh-shell-method-alt
24+
2225
The :method:`~Mongo.startSession()` method can take a document with
2326
session options. The options available are:
2427

source/reference/method/Session.abortTransaction.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ Definition
2121
without saving any of the changes made by the operations in the
2222
transaction.
2323

24+
.. |dbcommand| replace:: :dbcommand:`abortTransaction` command
25+
.. include:: /includes/fact-mongosh-shell-method-alt
26+
2427
.. include:: /includes/transaction-support
2528

2629

source/reference/method/Session.commitTransaction.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Definition
1818
Saves the changes made by the operations in the :doc:`multi-document
1919
transaction </core/transactions>` and ends the transaction.
2020

21+
.. |dbcommand| replace:: :dbcommand:`commitTransaction` command
22+
.. include:: /includes/fact-mongosh-shell-method-alt
23+
2124
.. include:: /includes/transaction-support
2225

2326

source/reference/method/Session.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,4 @@ method to retrieve the database object associated with the session.
101101
/reference/method/Session.abortTransaction
102102
/reference/method/Session.commitTransaction
103103
/reference/method/Session.startTransaction
104+
/reference/method/Session.withTransaction

source/reference/method/Session.withTransaction.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ Definition
2525
- commit operation, if there is a failure to commit.
2626
- entire transaction, if the error permits.
2727

28+
.. |dbcommand| replace:: :dbcommand:`commitTransaction` command
29+
.. include:: /includes/fact-mongosh-shell-method-alt
30+
2831
The :method:`Session.withTransaction()` method accepts the
2932
`transaction options
3033
<https://mongodb.github.io/node-mongodb-native/4.8/interfaces/TransactionOptions.html>`__.
@@ -33,7 +36,7 @@ Definition
3336
Behavior
3437
--------
3538

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
3740
known as the `Callback API
3841
<https://www.mongodb.com/docs/drivers/node/current/fundamentals/transactions/#callback-api>`__.
3942
The ``Callback API`` also accepts an callback, however the return type

0 commit comments

Comments
 (0)