Skip to content

Commit a9fb508

Browse files
authored
DOCSP-24399 collection interlink v4.2 (#1790)
* DOCSP-24399 Merge interlink from v4.4 * DOCSP-24399 Fixes build warnings * DOCSP-24399 Fixes build warnings
1 parent 6b1ed74 commit a9fb508

24 files changed

+91
-90
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
.. tip::
3+
4+
In the :program:`mongo` Shell, this command can also be run through the
5+
|method|.
6+
7+
Helper methods are convenient for :program:`mongo` users, but they may not
8+
return the same level of information as database commands. In cases where
9+
the convenience is not needed or the additional return fields are required,
10+
use the database command.
11+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. important:: ``mongo`` Shell Method
2+
3+
This page documents a :binary:`~bin.mongo` method. This is *not*
4+
the documentation for database commands or language-specific drivers,
5+
such as Node.js. To use the database command, see the |dbcommand|.
6+
7+
For MongoDB API drivers, refer to the language-specific
8+
:driver:`MongoDB driver documentation </>`.
9+

source/reference/command/aggregate.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ Definition
2020
to process data from a collection or other source with a sequence of
2121
stage-based manipulations.
2222

23+
.. |method| replace:: :method:`db.aggregate()` and
24+
:method:`db.collection.aggregate()` helper methods
25+
.. include:: /includes/fact-dbcommand-tip.rst
26+
2327
Syntax
2428
------
2529

source/reference/command/createIndexes.txt

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

1818
Builds one or more indexes on a collection.
1919

20+
.. |method| replace:: :method:`db.collection.createIndex()` and
21+
:method:`db.collection.createIndexes()` helper methods.
22+
.. include:: /includes/fact-dbcommand-tip.rst
23+
2024
The :dbcommand:`createIndexes` command takes the following form:
2125

2226
.. code-block:: javascript

source/reference/command/distinct.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ Definition
2020
an array of the distinct values. The return document also contains
2121
an embedded document with query statistics and the query plan.
2222

23+
.. |method| replace:: :method:`db.collection.distinct()` helper method.
24+
.. include:: /includes/fact-dbcommand-tip.rst
25+
2326
The command takes the following form
2427

2528
.. code-block:: javascript

source/reference/command/dropIndexes.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ dropIndexes
1616
(except the index on the ``_id`` field) from the specified
1717
collection.
1818

19+
.. |method| replace:: :method:`db.collection.dropIndex()` and
20+
:method:`db.collection.dropIndexes()` helper methods.
21+
.. include:: /includes/fact-dbcommand-tip.rst
22+
1923
The command has the following form:
20-
24+
2125
.. code-block:: javascript
2226

2327
{ dropIndexes: <string>, index: <string|document|arrayofstrings>, writeConcern: <document>}

source/reference/command/explain.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Definition
2121
:dbcommand:`findAndModify`, :dbcommand:`delete`, and
2222
:dbcommand:`update`.
2323

24-
Although MongoDB provides the :dbcommand:`explain` command, the
25-
preferred method for running :dbcommand:`explain` is to use the
26-
:method:`db.collection.explain()` and :method:`cursor.explain()` helpers.
24+
.. |method| replace:: :method:`db.collection.explain()` and
25+
:method:`cursor.explain()` helper methods
26+
.. include:: /includes/fact-dbcommand-tip.rst
2727

2828
The :dbcommand:`explain` command has the following syntax:
2929

source/reference/command/find.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ Definition
2020
Executes a query and returns the first batch of results and the
2121
cursor id, from which the client can construct a cursor.
2222

23-
.. tip::
24-
25-
Rather than run the :dbcommand:`find` command directly, you can
26-
use the :method:`db.collection.find()` helper provided in the
27-
:binary:`~bin.mongo` shell or the equivalent helper in the
28-
drivers.
23+
.. |method| replace:: :method:`db.collection.find()` or
24+
:method:`db.collection.findOne()` helper methods
25+
.. include:: /includes/fact-dbcommand-tip.rst
2926

3027
Syntax
3128
------

source/reference/command/findAndModify.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ Definition
2424
modifications made on the update. To return the document with the
2525
modifications made on the update, use the ``new`` option.
2626

27+
.. |method| replace:: :method:`db.collection.findAndModify()` helper method
28+
.. include:: /includes/fact-dbcommand-tip.rst
29+
30+
.. versionchanged:: 5.0
31+
2732
The command has the following syntax:
2833

2934
.. code-block:: none

source/reference/command/insert.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ Definition
1919
returns a document containing the status of all inserts. The insert
2020
methods provided by the MongoDB drivers use this command internally.
2121

22+
.. |method| replace:: :method:`db.collection.insertOne()` and
23+
:method:`db.collection.insertMany()` helper methods
24+
.. include:: /includes/fact-dbcommand-tip.rst
25+
2226
The command has the following syntax:
2327

2428
.. code-block:: javascript

0 commit comments

Comments
 (0)