Skip to content

Commit 3ce3b44

Browse files
authored
DOCSP-25472 collection interlinks v5.0 (#2128)
* DOCSP 25472 collection interlink ii (#1961) * DOCSP-25472 db.collection.isCapped * DOCSP-25472 db.collection.latencyStats * DOCSP-25472 db.collection.reIndex * DOCSP-25472 collection interlink * DOCSP-25472 collection interlink * DOCSP-25472 collection interlink * DOCSP-25472 collection interlink * DOCSP-25472 delete and update commands * DOCSP-25472 delete and update commands * DOCSP-25472 Adds mongosh interlink * DOCSP-25472 Adds mongosh interlink * DOCSP-25472 Fixes interlink to command * DOCSP-25472 Updates command tip * DOCSP-25472 Updates command tip * DOCSP-25472 Updates command tip * DOCSP-25472 Fixes build error * DOCSP-25472 Self-review fixes * DOCSP-25472 Self-review fixes * DOCSP-25472 Self-review fixes * DOCSP-25472 Fixes per Dave Cuthbert * DOCSP-25472 Fixes per Dave Cuthbert * DOCSP-25472 Fixes per Dave Cuthbert * DOCSP-25472 Fixes per Dave Cuthbert * DOCSP-25472 Fixes per Anna * DOCSP-25472 Fixes per Anna * DOCSP-25472 Fixes build issue
1 parent c011634 commit 3ce3b44

38 files changed

+132
-138
lines changed

source/includes/fact-mongosh-shell-method-alt.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
This page documents a :binary:`~bin.mongosh` method. This is *not*
44
the documentation for database commands or language-specific drivers,
5-
such as Node.js. To use the database command, see the |dbcommand|.
5+
such as Node.js.
6+
7+
For the database command, see the |dbcommand|.
68

79
For MongoDB API drivers, refer to the language-specific
810
:driver:`MongoDB driver documentation </>`.

source/reference/command/aggregate.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ 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
23+
.. |method| replace:: :method:`db.aggregate` and
24+
:method:`db.collection.aggregate` helper methods or with the
25+
:method:`~db.collection.watch` helper method
2526
.. include:: /includes/fact-dbcommand-tip
2627

2728
Syntax
@@ -49,13 +50,6 @@ The command has following syntax:
4950
let: <document> // Added in MongoDB 5.0
5051
}
5152

52-
.. tip::
53-
54-
Rather than run the :dbcommand:`aggregate` command directly, most
55-
users should use the :method:`db.collection.aggregate()` helper
56-
provided in :binary:`~bin.mongosh` or the equivalent helper in
57-
their driver. In 2.6 and later, the
58-
:method:`db.collection.aggregate()` helper always returns a cursor.
5953

6054
Command Fields
6155
~~~~~~~~~~~~~~

source/reference/command/collMod.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Definition
1818
:dbcommand:`collMod` makes it possible to add options to a collection
1919
or to modify view definitions.
2020

21+
.. |method| replace:: :method:`~db.collection.hideIndex` and
22+
:method:`~db.collection.unhideIndex` helper methods
23+
.. include:: /includes/fact-dbcommand-tip
24+
2125
.. note::
2226

2327
The view modified by this command does not refer to materialized
@@ -98,11 +102,6 @@ Index Options
98102
Modifying the index option ``hidden`` resets the
99103
:pipeline:`$indexStats` for the index if the value changes.
100104

101-
.. seealso::
102-
103-
- :method:`db.collection.hideIndex()`
104-
- :method:`db.collection.unhideIndex()`
105-
106105
.. versionadded:: 4.4
107106

108107
To change index options, specify either the key pattern or name of
@@ -126,7 +125,7 @@ Index Options
126125

127126
.. seealso::
128127

129-
- :doc:`/core/index-hidden`
128+
- :ref:`index-type-hidden`
130129
- :method:`db.collection.hideIndex()`
131130
- :method:`db.collection.unhideIndex()`
132131

source/reference/command/collStats.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ Definition
1818
The :dbcommand:`collStats` command returns a variety of storage statistics
1919
for a given collection.
2020

21+
.. |method| replace:: :method:`~db.collection.stats` helper method.
22+
Specific fields in the ``collStats`` output can be accessed using the
23+
:method:`~db.collection.dataSize`,
24+
:method:`~db.collection.estimatedDocumentCount`,
25+
:method:`~db.collection.isCapped`,
26+
:method:`~db.collection.latencyStats`,
27+
:method:`~db.collection.storageSize`,
28+
:method:`~db.collection.totalIndexSize`, and
29+
:method:`~db.collection.totalSize`
30+
helper methods
31+
.. include:: /includes/fact-dbcommand-tip
32+
2133
.. |command| replace:: ``collStats``
2234

2335
.. include:: /includes/fact-dbcommand.rst

source/reference/command/count.txt

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Definition
1818
Counts the number of documents in a collection or a view. Returns a
1919
document that contains this count and as well as the command status.
2020

21+
.. |method| replace:: :method:`~db.collection.count` helper method
22+
.. include:: /includes/fact-dbcommand-tip
23+
2124
.. note::
2225

2326
MongoDB drivers compatible with the 4.0 features deprecate their
@@ -131,33 +134,6 @@ Definition
131134

132135
.. versionadded:: 4.4
133136

134-
135-
136-
:binary:`~bin.mongosh` also provides the following wrapper methods for :dbcommand:`count`:
137-
138-
- :method:`~cursor.count()`
139-
- :method:`db.collection.estimatedDocumentCount()`
140-
- :method:`db.collection.count()`
141-
142-
.. important::
143-
144-
- Avoid using the :dbcommand:`count` and its wrapper methods
145-
without a query predicate (note:
146-
:method:`db.collection.estimatedDocumentCount()` does not take
147-
a query predicate) since without the query predicate, these
148-
operations return results based on the collection's metadata,
149-
which may result in an approximate count. In particular,
150-
151-
- On a sharded cluster, the resulting count will not correctly
152-
filter out :term:`orphaned documents <orphaned document>`.
153-
154-
- :ref:`After an unclean shutdown <count-accuracy-shutdown>`,
155-
the count may be incorrect.
156-
157-
- For counts based on collection metadata, see also
158-
:ref:`collStats pipeline stage with the count <collstat-count>`
159-
option.
160-
161137
Stable API Support
162138
------------------
163139

source/reference/command/delete.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ Definition
2323

2424
.. versionchanged:: 5.0
2525

26+
.. |method| replace:: :method:`~db.collection.deleteOne`,
27+
:method:`~db.collection.deleteMany`, and
28+
:method:`~db.collection.findOneAndDelete`
29+
helper methods
30+
.. include:: /includes/fact-dbcommand-tip
31+
2632
.. _delete-syntax:
2733

2834
The :dbcommand:`delete` command has the following syntax:
@@ -202,10 +208,6 @@ Definition
202208
For an example, see :ref:`ex-delete-command-hint`.
203209

204210
.. versionadded:: 4.4
205-
206-
207-
208-
209211

210212
:returns:
211213

source/reference/command/drop.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ drop
1010
:depth: 1
1111
:class: singlecol
1212

13+
Syntax
14+
------
15+
1316
.. dbcommand:: drop
1417

1518
The :dbcommand:`drop` command removes an entire collection from a
1619
database. The command has following syntax:
1720

21+
.. |method| replace:: :method:`~db.collection.drop` helper method
22+
.. include:: /includes/fact-dbcommand-tip
23+
1824
.. code-block:: javascript
1925

2026
{ drop: <collection_name>, writeConcern: <document>, comment: <any> }

source/reference/command/mapReduce.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Definition
2222
The :dbcommand:`mapReduce` command allows you to run
2323
:term:`map-reduce` aggregation operations over a collection.
2424

25+
.. |method| replace:: :method:`~db.collection.mapReduce` helper method
26+
.. include:: /includes/fact-dbcommand-tip
27+
2528
Syntax
2629
------
2730

source/reference/command/reIndex.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Definition
1515

1616
.. dbcommand:: reIndex
1717

18+
.. |method| replace:: :method:`db.collection.reIndex` helper method
19+
.. include:: /includes/fact-dbcommand-tip
20+
1821
The :dbcommand:`reIndex` command drops all indexes on a
1922
collection and recreates them. This operation may be expensive for
2023
collections that have a large amount of data and/or a large number
@@ -37,15 +40,13 @@ Definition
3740
.. list-table::
3841
:header-rows: 1
3942
:widths: 20 80
40-
43+
4144
* - Field
4245
- Description
43-
46+
4447
* - reIndex
4548
- The name of the collection to reindex.
46-
47-
:binary:`~bin.mongosh` provides a wrapper :method:`db.collection.reIndex()`.
48-
49+
4950
Behavior
5051
--------
5152

source/reference/command/renameCollection.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Definition
1919
to :dbcommand:`renameCollection` in the form of a complete
2020
:term:`namespace` (``<database>.<collection>``).
2121

22+
.. |method| replace:: :method:`~db.collection.renameCollection` helper method
23+
.. include:: /includes/fact-dbcommand-tip
24+
2225
Issue the :dbcommand:`renameCollection` command against the
2326
:term:`admin database`.
2427

0 commit comments

Comments
 (0)