Skip to content

Commit 8120943

Browse files
authored
DOCSP-24513 interlink db methods v6.0 (#2229)
* DOCSP-24513 Interlink of Mongosh Methods to Database Commands I (#2222) * DOCSP-24513 Adds interlinks for db.% mongosh methods * Interlinks commands and methods * Interlinks commands and methods * Fixes build error * Fixes build error * Fixes per Joe D. * Fixes per Joe D. * Fixes per Ashley * Fixes per Ashley * Fixes build error
1 parent 7bad450 commit 8120943

13 files changed

+154
-149
lines changed

source/reference/command/createUser.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ Definition
2121
:dbcommand:`createUser` command returns a *duplicate user* error if the
2222
user exists.
2323

24+
.. |method| replace:: :method:`db.createUser` helper method
25+
.. include:: /includes/fact-dbcommand-tip
26+
2427
Syntax
2528
------
2629

source/reference/command/dropAllUsersFromDatabase.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Definition
1818
Removes all users from the database on which you run the
1919
command.
2020

21+
.. |method| replace:: :method:`db.dropAllUsers` helper method
22+
.. include:: /includes/fact-dbcommand-tip
23+
2124
.. warning::
2225

2326
The :dbcommand:`dropAllUsersFromDatabase` removes all users from the database.

source/reference/command/dropUser.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Definition
1717

1818
Removes the user from the database on which you run the command.
1919

20+
.. |method| replace:: :method:`db.dropUser` helper method
21+
.. include:: /includes/fact-dbcommand-tip
22+
2023
Syntax
2124
------
2225

source/reference/command/grantRolesToUser.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Definition
1717

1818
Grants additional roles to a user.
1919

20+
.. |method| replace:: :method:`db.grantRolesToUser` helper method
21+
.. include:: /includes/fact-dbcommand-tip
22+
2023
Syntax
2124
------
2225

source/reference/command/revokeRolesFromUser.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ Definition
1515

1616
.. dbcommand:: revokeRolesFromUser
1717

18-
Removes a one or more roles from a user on the database where the
18+
Removes one or more roles from a user on the database where the
1919
roles exist.
2020

21+
.. |method| replace:: :method:`db.revokeRolesFromUser` helper method
22+
.. include:: /includes/fact-dbcommand-tip
23+
2124
Syntax
2225
------
2326

source/reference/command/updateUser.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Definition
2323
field's values, including updates to the user's ``roles`` and
2424
``authenticationRestrictions`` arrays.
2525

26+
.. |method| replace:: :method:`db.changeUserPassword` helper method
27+
.. include:: /includes/fact-dbcommand-tip
28+
2629
.. warning::
2730

2831
When you update the ``roles`` array, you completely replace the

source/reference/method/db.aggregate.txt

Lines changed: 114 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -19,158 +19,126 @@ Definition
1919
underlying collection. For aggregations on collection data, see
2020
:method:`db.collection.aggregate()`.
2121

22+
.. |dbcommand| replace:: :dbcommand:`aggregate` command
23+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
24+
2225
The :method:`db.aggregate()` method has the following syntax:
2326

2427
.. code-block:: javascript
2528

2629
db.aggregate( [ <pipeline> ], { <options> } )
2730

28-
- The ``pipeline`` parameter is an array of stages to execute. It
29-
must start with a compatible stage that does not require an
30-
underlying collection, such as :pipeline:`$currentOp` or
31-
:pipeline:`$listLocalSessions`.
32-
33-
- The ``options`` document can contain the following fields and values:
34-
35-
36-
.. list-table::
37-
:header-rows: 1
38-
:widths: 20 20 80
39-
40-
* - Field
41-
42-
- Type
43-
44-
- Description
45-
46-
* - ``explain``
47-
48-
- boolean
49-
50-
- Optional. Specifies to return the information on the processing of the pipeline. See
51-
:ref:`example-aggregate-method-explain-option` for an example.
52-
53-
Not available in :doc:`multi-document transactions </core/transactions>`.
54-
55-
56-
57-
* - ``allowDiskUse``
58-
59-
- boolean
60-
61-
- Optional. Enables writing to temporary files. When set to ``true``, aggregation
62-
operations can write data to the :file:`_tmp` subdirectory in the
63-
:setting:`~storage.dbPath` directory. See
64-
:ref:`example-aggregate-method-external-sort` for an example.
65-
66-
.. include:: /includes/extracts/4.2-changes-usedDisk.rst
67-
68-
69-
70-
* - ``cursor``
71-
72-
- document
73-
74-
- Optional. Specifies the *initial* batch size for the cursor. The value of the ``cursor``
75-
field is a document with the field ``batchSize``. See
76-
:ref:`example-aggregate-method-initial-batch-size` for syntax and example.
77-
78-
79-
* - ``maxTimeMS``
80-
81-
- non-negative integer
82-
83-
- Optional. Specifies a time limit in milliseconds for processing
84-
operations on a cursor. If you do not specify a value for maxTimeMS,
85-
operations will not time out. A value of ``0`` explicitly
86-
specifies the default unbounded behavior.
87-
88-
MongoDB terminates operations that exceed their allotted time limit
89-
using the same mechanism as :method:`db.killOp()`. MongoDB only
90-
terminates an operation at one of its designated :term:`interrupt
91-
points <interrupt point>`.
92-
93-
94-
95-
* - ``bypassDocumentValidation``
96-
97-
- boolean
98-
99-
- Optional. Applicable only if you specify the :pipeline:`$out` or :pipeline:`$merge` aggregation
100-
stages.
101-
102-
103-
104-
Enables :method:`db.collection.aggregate` to bypass document validation
105-
during the operation. This lets you insert documents that do not
106-
meet the validation requirements.
107-
108-
109-
110-
* - ``readConcern``
111-
112-
- document
113-
114-
- Optional. Specifies the :term:`read concern`.
115-
116-
.. include:: /includes/fact-readConcern-syntax.rst
117-
118-
.. include:: /includes/fact-readConcern-option-description.rst
119-
120-
.. include:: /includes/extracts/4.2-changes-out-linearizable.rst
121-
122-
.. include:: /includes/extracts/4.2-changes-linearizable-merge-restriction.rst
123-
124-
125-
126-
* - ``collation``
127-
128-
- document
129-
130-
- Optional.
131-
132-
.. include:: /includes/extracts/collation-option.rst
133-
134-
135-
136-
* - ``hint``
137-
138-
- string or document
139-
140-
- Optional. The index to use for the aggregation. The index is on the initial
141-
collection/view against which the aggregation is run.
142-
143-
Specify the index either by the index name or by the index
144-
specification document.
145-
146-
.. note::
147-
148-
The ``hint`` does not apply to :pipeline:`$lookup` and
149-
:pipeline:`$graphLookup` stages.
150-
151-
152-
153-
* - ``comment``
154-
155-
- string
156-
157-
- Optional. Users can specify an arbitrary string to help trace the operation
158-
through the database profiler, currentOp, and logs.
159-
160-
161-
162-
* - ``writeConcern``
163-
164-
- document
165-
166-
- Optional. A document that expresses the :doc:`write concern </reference/write-concern>`
167-
to use with the :pipeline:`$out` or :pipeline:`$merge` stage.
168-
169-
Omit to use the default write concern with the :pipeline:`$out` or
170-
:pipeline:`$merge` stage.
171-
172-
173-
31+
The ``pipeline`` parameter is an array of stages to execute. It
32+
must start with a compatible stage that does not require an
33+
underlying collection, such as :pipeline:`$currentOp` or
34+
:pipeline:`$listLocalSessions`.
35+
36+
The ``options`` document can contain the following fields and values:
37+
38+
.. list-table::
39+
:header-rows: 1
40+
:widths: 20 20 80
41+
42+
* - Field
43+
- Type
44+
- Description
45+
46+
47+
* - ``explain``
48+
- boolean
49+
- Optional. Specifies that the method should return
50+
information on the processing of the pipeline.
51+
52+
See :ref:`example-aggregate-method-explain-option` for an example.
53+
54+
Not available in :ref:`multi-document transactions <transactions>`.
55+
56+
57+
* - ``allowDiskUse``
58+
- boolean
59+
- Optional. Enables writing to temporary files. When set to ``true``, aggregation
60+
operations can write data to the :file:`_tmp` subdirectory in the
61+
:setting:`~storage.dbPath` directory. See
62+
:ref:`example-aggregate-method-external-sort` for an example.
63+
64+
.. include:: /includes/extracts/4.2-changes-usedDisk.rst
65+
66+
* - ``cursor``
67+
- document
68+
- Optional. Specifies the *initial* batch size for the cursor. The value
69+
of the ``cursor`` field is a document with the field ``batchSize``. See
70+
:ref:`example-aggregate-method-initial-batch-size` for syntax and example.
71+
72+
73+
* - ``maxTimeMS``
74+
- non-negative integer
75+
- Optional. Specifies a time limit in milliseconds for processing
76+
operations on a cursor. If you do not specify a value for maxTimeMS,
77+
operations will not time out. A value of ``0`` explicitly
78+
specifies the default unbounded behavior.
79+
80+
MongoDB terminates operations that exceed their allotted time limit
81+
using the same mechanism as :method:`db.killOp()`. MongoDB only
82+
terminates an operation at one of its designated :term:`interrupt
83+
points <interrupt point>`.
84+
85+
86+
* - ``bypassDocumentValidation``
87+
- boolean
88+
- Optional. Applicable only if you specify the :pipeline:`$out` or :pipeline:`$merge` aggregation
89+
stages.
90+
91+
Enables :method:`db.collection.aggregate` to bypass document validation
92+
during the operation. This lets you insert documents that do not
93+
meet the validation requirements.
94+
95+
* - ``readConcern``
96+
- document
97+
- Optional. Specifies the :term:`read concern`.
98+
99+
.. include:: /includes/fact-readConcern-syntax.rst
100+
101+
.. include:: /includes/fact-readConcern-option-description.rst
102+
103+
.. include:: /includes/extracts/4.2-changes-out-linearizable.rst
104+
105+
.. include:: /includes/extracts/4.2-changes-linearizable-merge-restriction.rst
106+
107+
108+
* - ``collation``
109+
- document
110+
- Optional.
111+
112+
.. include:: /includes/extracts/collation-option.rst
113+
114+
115+
* - ``hint``
116+
- string or document
117+
- Optional. The index to use for the aggregation. The index is on the initial
118+
collection/view against which the aggregation is run.
119+
120+
Specify the index either by the index name or by the index
121+
specification document.
122+
123+
.. note::
124+
125+
The ``hint`` does not apply to :pipeline:`$lookup` and
126+
:pipeline:`$graphLookup` stages.
127+
128+
129+
* - ``comment``
130+
- string
131+
- Optional. Users can specify an arbitrary string to help trace the operation
132+
through the database profiler, currentOp, and logs.
133+
134+
135+
* - ``writeConcern``
136+
- document
137+
- Optional. A document that expresses the :ref:`write concern <write-concern>`
138+
to use with the :pipeline:`$out` or :pipeline:`$merge` stage.
139+
140+
Omit to use the default write concern with the :pipeline:`$out` or
141+
:pipeline:`$merge` stage.
174142

175143

176144
Example

source/reference/method/db.changeUserPassword.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Definition
1919
user is defined, i.e. the database you :method:`created
2020
<db.createUser()>` the user.
2121

22+
.. |dbcommand| replace:: :dbcommand:`updateUser` command
23+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
2224

2325
.. list-table::
2426
:header-rows: 1

source/reference/method/db.createUser.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Definition
1919
:method:`db.createUser()` returns a *duplicate user* error if the
2020
user already exists on the database.
2121

22+
.. |dbcommand| replace:: :dbcommand:`createUser` command
23+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
24+
2225
The :method:`db.createUser()` method has the following syntax:
2326

2427

source/reference/method/db.dropAllUsers.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Definition
1717

1818
Removes all users from the current database.
1919

20+
.. |dbcommand| replace:: :dbcommand:`dropAllUsersFromDatabase` command
21+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
22+
2023
.. warning::
2124

2225
The :method:`db.dropAllUsers` method removes all users from the

source/reference/method/db.dropUser.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Definition
1717

1818
Removes the user from the current database.
1919

20+
.. |dbcommand| replace:: :dbcommand:`dropUser` command
21+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
22+
2023
The :method:`db.dropUser()` method takes the following arguments:
2124

2225

source/reference/method/db.grantRolesToUser.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Definition
1717

1818
Grants additional roles to a user.
1919

20+
.. |dbcommand| replace:: :dbcommand:`grantRolesToUser` command
21+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
22+
2023
The :method:`db.grantRolesToUser()` method uses the following syntax:
2124

2225
.. code-block:: javascript

0 commit comments

Comments
 (0)