Skip to content

Commit 4d29070

Browse files
committed
change batchsize wording
1 parent e6182b8 commit 4d29070

File tree

5 files changed

+27
-12
lines changed

5 files changed

+27
-12
lines changed

source/includes/extracts-watch-option.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
ref: watch-option-batchSize
22
content: |
3-
Specifies the batch size for the cursor, which will apply to both the initial
4-
``aggregate`` command and any subsequent ``getMore`` commands. This determines
5-
the maximum number of change events to return in each response from the
6-
server.
3+
4+
Specifies the batch size for the cursor, which will apply to both the
5+
initial ``aggregate`` command and any subsequent ``getMore`` commands.
6+
If batchSize is set, ``aggregate`` and any subsequent ``getMore`` commands returns the smaller of 16 megabytes of data
7+
or batchSize documents. Operations of type ``find()``, ``aggregate()``, ``listIndexes``, and ``listCollections`` return a maximum of ``16`` megabytes per batch.
8+
batchSize can enforce a smaller limit than ``16`` megabytes, but not a larger one.
79
810
Irrespective of the ``batchSize`` option, the initial ``aggregate`` command
911
response for a change stream generally does not include any documents

source/read/retrieve.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ you can set in the array:
180180
- Description
181181

182182
* - ``batchSize``
183-
- | The number of documents to return per batch. The default value is ``101``.
183+
- | The limit for each batch returned in a query result. The ``find()`` method has an initial batch size of 101 documents by default and returns a maximum of 16
184+
megabytes per batch. Subsequent ``getMore`` operations issued against the resulting cursor have no default batch size,
185+
so they are limited only by the ``16`` megabyte message size. batchSize can enforce a smaller limit than ``16`` megabytes, but not a larger one.
184186
| **Type**: ``integer``
185187

186188
* - ``collation``

source/reference/method/MongoDBCollection-find.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ Parameters
5252

5353
* - batchSize
5454
- integer
55-
- The number of documents to return in the first batch. Defaults to
56-
``101``. A batchSize of ``0`` means that the cursor will be
55+
- Sets the number of documents to return in the first batch if the number of documents to return is over ``101``.
56+
Defaults to `101``. A batchSize of ``0`` means that the cursor will be
5757
established, but no documents will be returned in the first batch.
5858

5959
Unlike the previous wire protocol version, a batchSize of ``1`` for the

source/reference/method/MongoDBCollection-listSearchIndexes.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ Parameters
4040

4141
* - batchSize
4242
- integer
43-
- Specifies the batch size for the cursor, which will apply to both the
43+
- Specifies the batch size for the cursor, which will apply to both thex
4444
initial ``aggregate`` command and any subsequent ``getMore`` commands.
45-
This determines the maximum number of documents to return in each
46-
response from the server.
45+
If batchSize is set, ``aggregate`` and any subsequent ``getMore`` commands returns the smaller of ``16`` megabytes of data
46+
or batchSize documents. Operations of type ``find()``, ``aggregate()``, ``listIndexes``, and ``listCollections`` return a maximum of ``16`` megabytes per batch.
47+
batchSize can enforce a smaller limit than ``16`` megabytes, but not a larger one.
48+
49+
If batchSize is not set, ``aggregate`` and ``getMore`` commands return up to ``16`` megabytes of data.
4750

4851
A batchSize of ``0`` is special in that and will only apply to the
4952
initial ``aggregate`` command; subsequent ``getMore`` commands will use

source/reference/method/MongoDBDatabase-aggregate.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,16 @@ Parameters
5656
- integer
5757
- Specifies the batch size for the cursor, which will apply to both the
5858
initial ``aggregate`` command and any subsequent ``getMore`` commands.
59-
This determines the maximum number of documents to return in each
60-
response from the server.
59+
60+
The ``aggregate`` command has an initial batch size of 101 documents by default.
61+
Subsequent ``getMore`` operations issued against the resulting cursor have no default batch size,
62+
so they are limited only by the ``16`` megabyte message size.
63+
64+
If batchSize is set, ``aggregate`` and any subsequent ``getMore`` commands returns the smaller of 16 megabytes of data
65+
or batchSize documents. Operations of type ``aggregate`` return a maximum of ``16`` megabytes per batch.
66+
batchSize can enforce a smaller limit than ``16`` megabytes, but not a larger one.
67+
68+
If batchSize is not set, ``aggregate`` and ``getMore`` commands return up to ``16`` megabytes of data.
6169

6270
A batchSize of ``0`` is special in that and will only apply to the
6371
initial ``aggregate`` command; subsequent ``getMore`` commands will use

0 commit comments

Comments
 (0)