Skip to content

Commit c5f8541

Browse files
authored
DOCSP-21629 Consistent Syntax Examples: R (#1490)
1 parent 5f72176 commit c5f8541

22 files changed

+709
-625
lines changed

source/reference/command/reIndex.txt

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,35 @@ Definition
3131
instances.
3232
- For most users, the :dbcommand:`reIndex` command is unnecessary.
3333

34-
Use the following syntax:
35-
36-
.. code-block:: javascript
37-
38-
{ reIndex: <collection> }
39-
40-
The command takes the following fields:
41-
42-
.. list-table::
43-
:header-rows: 1
44-
:widths: 20 80
45-
46-
* - Field
47-
- Description
48-
49-
* - reIndex
50-
- The name of the collection to reindex.
51-
52-
:binary:`~bin.mongosh` provides a wrapper :method:`db.collection.reIndex()`.
34+
Syntax
35+
------
36+
37+
The command has the following syntax:
38+
39+
.. code-block:: javascript
40+
41+
db.runCommand(
42+
{
43+
reIndex: <collection>
44+
}
45+
)
46+
47+
Command Fields
48+
--------------
49+
50+
The command takes the following fields:
51+
52+
.. list-table::
53+
:header-rows: 1
54+
:widths: 20 80
55+
56+
* - Field
57+
- Description
58+
59+
* - reIndex
60+
- The name of the collection to reindex.
61+
62+
:binary:`~bin.mongosh` provides a wrapper :method:`db.collection.reIndex()`.
5363

5464
Behavior
5565
--------

source/reference/command/refineCollectionShardKey.txt

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,45 +46,39 @@ Syntax
4646
cluster must have :ref:`feature compatibility version (fcv) <view-fcv>`
4747
of ``4.4``.
4848

49-
The :dbcommand:`refineCollectionShardKey` command must be run against
50-
the ``admin`` database and has the following form:
49+
The command has the following syntax:
5150

5251
.. code-block:: javascript
5352

54-
db.adminCommand( {
55-
refineCollectionShardKey: "<database>.<collection>",
56-
key: { <existing key specification>, <suffix1>: <1|"hashed">, ... }
57-
} )
53+
db.adminCommand(
54+
{
55+
refineCollectionShardKey: "<database>.<collection>",
56+
key: { <existing key specification>, <suffix1>: <1|"hashed">, ... }
57+
}
58+
)
5859

5960
Command Fields
60-
~~~~~~~~~~~~~~
61-
62-
The :dbcommand:`refineCollectionShardKey` command has the following fields:
61+
--------------
6362

63+
The command takes the following fields:
6464

6565
.. list-table::
6666
:header-rows: 1
6767
:widths: 20 20 80
6868

6969
* - Field
70-
7170
- Type
72-
7371
- Description
7472

7573
* - :ref:`refineCollectionShardKey <refineCollectionShardKey-namespace>`
76-
7774
- string
78-
7975
- .. _refineCollectionShardKey-namespace:
8076

8177
The :term:`namespace` of the sharded collection in the
8278
form ``"<database>.<collection>"``.
8379

8480
* - :ref:`key <refineCollectionShardKey-key>`
85-
8681
- document
87-
8882
- .. _refineCollectionShardKey-key:
8983

9084
The document that specifies the field or fields to use as the

source/reference/command/refreshSessions.txt

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,34 @@ Definition
1919
for the specified sessions, thereby extending the active state of
2020
the sessions.
2121

22-
:dbcommand:`refreshSessions` has the following syntax:
22+
Syntax
23+
------
2324

24-
.. code-block:: javascript
25+
The command has the following syntax:
2526

26-
{ refreshSessions: [ { id : <UUID> }, ... ] } )
27+
.. code-block:: javascript
2728

28-
.. include:: /includes/fact-dbcommand.rst
29+
db.runCommand(
30+
{
31+
refreshSessions: [
32+
{ id : <UUID> }, ...
33+
]
34+
}
35+
)
2936

30-
.. |command| replace:: :dbcommand:`refreshSessions`
37+
.. include:: /includes/fact-dbcommand.rst
3138

32-
.. code-block:: javascript
39+
.. |command| replace:: :dbcommand:`refreshSessions`
3340

34-
db.runCommand( { refreshSessions: [ { id : <UUID> }, ... ] } )
41+
.. code-block:: javascript
3542

43+
db.runCommand(
44+
{
45+
refreshSessions: [
46+
{ id : <UUID> }, ...
47+
]
48+
}
49+
)
3650

3751
Behavior
3852
--------

source/reference/command/removeShard.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ removeShard
1010
:depth: 1
1111
:class: singlecol
1212

13+
Definition
14+
----------
15+
1316
.. dbcommand:: removeShard
1417

1518
Removes a shard from a :term:`sharded cluster`. When you run
@@ -18,14 +21,17 @@ removeShard
1821
drained, MongoDB removes the shard from the cluster.
1922

2023
Syntax
21-
-------
24+
------
2225

23-
To run, from a :binary:`~bin.mongos` instance, issue the command
24-
against the ``admin`` database:
26+
The command has the following syntax:
2527

2628
.. code-block:: javascript
2729

28-
db.adminCommand( { removeShard : <shardToRemove> } )
30+
db.adminCommand(
31+
{
32+
removeShard : <shardToRemove>
33+
}
34+
)
2935

3036
Behavior
3137
--------

source/reference/command/removeShardFromZone.txt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Syntax
2626
You can only run :dbcommand:`removeShardFromZone` on the ``admin`` database
2727
from a :binary:`~bin.mongos` instance.
2828

29-
The :dbcommand:`removeShardFromZone` command has the following syntax:
29+
The command has the following syntax:
3030

3131
.. code-block:: javascript
3232

@@ -37,41 +37,33 @@ The :dbcommand:`removeShardFromZone` command has the following syntax:
3737
}
3838
)
3939

40-
The command takes the following fields:
40+
Command Fields
41+
--------------
4142

43+
The command takes the following fields:
4244

4345
.. list-table::
4446
:header-rows: 1
4547
:widths: 20 20 80
4648

4749
* - Field
48-
4950
- Type
50-
5151
- Description
5252

5353
* - :ref:`removeShardFromZone <cmd-removeShardFromZone-shard>`
54-
5554
- string
56-
5755
- .. _cmd-removeShardFromZone-shard:
5856

5957
The name of the shard from which to remove the :ref:`zone
6058
<cmd-removeShardFromZone-zone>` association.
6159

62-
63-
6460
* - :ref:`zone <cmd-removeShardFromZone-zone>`
65-
6661
- string
67-
6862
- .. _cmd-removeShardFromZone-zone:
6963

7064
The name of the zone whose association with the :ref:`shard
7165
<cmd-removeShardFromZone-shard>` you want to remove.
7266

73-
74-
7567
:binary:`~bin.mongosh` provides the helper method
7668
:method:`sh.removeShardFromZone()`.
7769

source/reference/command/renameCollection.txt

Lines changed: 56 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -22,75 +22,68 @@ Definition
2222
Issue the :dbcommand:`renameCollection` command against the
2323
:term:`admin database`.
2424

25-
The command takes the following form:
25+
Syntax
26+
------
2627

27-
.. code-block:: javascript
28+
The command has the following syntax:
2829

29-
{ renameCollection: "<source_namespace>",
30+
.. code-block:: javascript
31+
32+
db.runCommand(
33+
{
34+
renameCollection: "<source_namespace>",
3035
to: "<target_namespace>",
3136
dropTarget: <true|false>,
3237
writeConcern: <document>,
33-
comment: <any> }
34-
35-
The command contains the following fields:
36-
37-
38-
.. list-table::
39-
:header-rows: 1
40-
:widths: 20 20 80
41-
42-
* - Field
43-
44-
- Type
45-
46-
- Description
47-
48-
* - ``renameCollection``
49-
50-
- string
51-
52-
- The :term:`namespace` of the collection to rename. The namespace is a
53-
combination of the database name and the name of the collection.
54-
55-
* - ``to``
56-
57-
- string
58-
59-
- The new namespace of the collection. If the new namespace specifies a
60-
different database, the :dbcommand:`renameCollection` command copies
61-
the collection to the new database and drops the source collection.
62-
See :ref:`restrictions-on-db-names`.
63-
64-
* - ``dropTarget``
65-
66-
- boolean
67-
68-
- Optional. If ``true``, :binary:`~bin.mongod` will drop the ``target`` of
69-
:dbcommand:`renameCollection` prior to renaming the collection. The
70-
default value is ``false``.
71-
72-
73-
74-
* - ``writeConcern``
75-
76-
- document
77-
78-
- Optional. A document that expresses the :doc:`write concern </reference/write-concern>`
79-
for the operation. Omit to use the default write
80-
concern.
81-
82-
.. include:: /includes/extracts/mongos-operations-wc-rename-collection.rst
83-
84-
* - ``comment``
85-
86-
- any
87-
88-
- .. include:: /includes/extracts/comment-content.rst
38+
comment: <any>
39+
}
40+
)
41+
42+
Command Fields
43+
--------------
44+
45+
The command contains the following fields:
46+
47+
.. list-table::
48+
:header-rows: 1
49+
:widths: 20 20 80
50+
51+
* - Field
52+
- Type
53+
- Description
54+
55+
* - ``renameCollection``
56+
- string
57+
- The :term:`namespace` of the collection to rename. The namespace is a
58+
combination of the database name and the name of the collection.
59+
60+
* - ``to``
61+
- string
62+
- The new namespace of the collection. If the new namespace specifies a
63+
different database, the :dbcommand:`renameCollection` command copies
64+
the collection to the new database and drops the source collection.
65+
See :ref:`restrictions-on-db-names`.
66+
67+
* - ``dropTarget``
68+
- boolean
69+
- Optional. If ``true``, :binary:`~bin.mongod` will drop the ``target`` of
70+
:dbcommand:`renameCollection` prior to renaming the collection. The
71+
default value is ``false``.
72+
73+
* - ``writeConcern``
74+
- document
75+
- Optional. A document that expresses the :doc:`write concern </reference/write-concern>`
76+
for the operation. Omit to use the default write
77+
concern.
8978

90-
.. versionadded:: 4.4
91-
92-
93-
79+
.. include:: /includes/extracts/mongos-operations-wc-rename-collection.rst
80+
81+
* - ``comment``
82+
- any
83+
- .. include:: /includes/extracts/comment-content.rst
84+
85+
.. versionadded:: 4.4
86+
9487
Behavior
9588
--------
9689

source/reference/command/replSetAbortPrimaryCatchUp.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,17 @@ Definition
1717

1818
The ``replSetAbortPrimaryCatchUp`` command forces the elected
1919
:term:`primary` member of the replica set to abort sync (catch up)
20-
then complete the transition to primary. The command has the
21-
following prototype form:
20+
then complete the transition to primary.
2221

23-
.. code-block:: javascript
22+
Syntax
23+
------
2424

25-
{ replSetAbortPrimaryCatchUp: 1 }
25+
The command has the following syntax:
26+
27+
.. code-block:: javascript
28+
29+
db.runCommand(
30+
{
31+
replSetAbortPrimaryCatchUp: 1
32+
}
33+
)

0 commit comments

Comments
 (0)