Skip to content

Commit a0abf58

Browse files
authored
DOCS-11263 updated batchSize to link to the correct command (#4027)
* DOCS-11263 made a mistake and did not update one of the links for the previous ticket this PR fixes that * format improvements * review improvements * final improvements * rewording * consolidated PRs and made an includes statement * clarity edits * fixed technical errors * tighten copy * nits
1 parent 4b502d2 commit a0abf58

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The ``{ cursor: { batchSize: 0 } }`` document, which specifies the size of the
2+
*initial* batch size, indicates an empty first batch. This batch size is useful
3+
for quickly returning a cursor or failure message without doing significant
4+
server-side work.
5+
6+
To specify batch size for subsequent :dbcommand:`getMore` operations
7+
(after the initial batch), use the ``batchSize`` field when running the
8+
:dbcommand:`getMore` command.
9+

source/reference/command/aggregate.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -458,13 +458,7 @@ To specify an *initial* batch size, specify the ``batchSize`` in the
458458
{ cursor: { batchSize: 0 } }
459459
)
460460

461-
The ``{batchSize: 0 }`` document specifies the size of the *initial*
462-
batch size only. Specify subsequent batch sizes for future ``getMore`` operations
463-
with the ``batchSize`` parameter. Mongosh provides the :method:`~cursor.batchSize()`
464-
to specify the ``batchSize``. More information about this parameter can be found
465-
here: :dbcommand:`getMore` . A ``batchSize`` of ``0`` means
466-
an empty first batch and is useful if you want to quickly get back a cursor or
467-
failure message, without doing significant server-side work.
461+
.. include:: /includes/batch-size-aggregate.rst
468462

469463
Specify a Collation
470464
~~~~~~~~~~~~~~~~~~~

source/reference/method/db.collection.aggregate.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,7 @@ For example, the following aggregation operation specifies the
446446
}
447447
)
448448

449-
A ``batchSize`` of ``0`` means an empty
450-
first batch and is useful for quickly returning a cursor or failure
451-
message without doing significant server-side work. Specify subsequent
452-
batch sizes for future ``getMore`` operations with :method:`~cursor.batchSize()`.
449+
.. include:: /includes/batch-size-aggregate.rst
453450

454451
.. include:: /includes/note-mongo-shell-automatically-iterates-cursor.rst
455452

0 commit comments

Comments
 (0)