File tree Expand file tree Collapse file tree 4 files changed +23
-6
lines changed Expand file tree Collapse file tree 4 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,14 @@ customize its behavior:
163
163
164
164
* - ``batchSize()``
165
165
- | Specifies the maximum number of change events to return in each batch of the
166
- response from the MongoDB cluster.
166
+ response from the MongoDB cluster. By default, returns an initial batch size
167
+ of ``101`` documents and a maximum size of 16 mebibytes (MiB) for each subsequent batch.
168
+ This option can enforce a smaller limit than 16 MiB, but not a larger one. If you set
169
+ ``batchSize`` to a limit that results in batches larger than 16 MiB, this
170
+ option has no effect.
171
+
172
+ | A ``batchSize`` of ``0`` means that the cursor will be established, but no documents
173
+ will be returned in the first batch.
167
174
168
175
* - ``collation()``
169
176
- | Specifies the collation to use for the change stream cursor.
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ cursors reduce both memory consumption and network bandwidth usage.
29
29
30
30
In the {+driver-short+}, some streams are backed by cursors. The size of batches used
31
31
in these underlying cursors depends on the demand requested on the ``Subscription`` for the
32
- ``Publisher``. The batch size of data contained by each underlying cursor can be set by
32
+ ``Publisher``. You can set the batch size of data contained by each underlying cursor by
33
33
using the ``FindPublisher.batchSize()`` method.
34
34
35
35
Sample Data
Original file line number Diff line number Diff line change @@ -113,7 +113,12 @@ The following table describes some methods you can use to customize the
113
113
- Description
114
114
115
115
* - ``batchSize()``
116
- - | Sets the number of documents to return per batch.
116
+ - | Sets the number of documents to return per batch. By default, returns an initial batch size
117
+ of ``101`` documents and a maximum size of 16 mebibytes (MiB) for each subsequent batch.
118
+ This option can enforce a smaller limit than 16 MiB, but not a larger one.
119
+
120
+ | A ``batchSize`` of ``0`` means that the cursor will be established, but no documents
121
+ will be returned in the first batch.
117
122
118
123
* - ``collation()``
119
124
- | Specifies the kind of language collation to use when sorting
Original file line number Diff line number Diff line change @@ -129,9 +129,14 @@ to it. The following table describes commonly used methods:
129
129
- Description
130
130
131
131
* - ``batchSize(int batchSize)``
132
- - | Limits the number of documents to hold in a cursor at a given time. To
133
- learn more about cursors, see :manual:`cursor
134
- </reference/glossary/#std-term-cursor>` in the MongoDB Server documentation.
132
+ - | The maximum number of documents within each batch returned in a query result. By default, the ``find``
133
+ command has an initial batch size of ``101`` documents and a maximum size of 16 mebibytes (MiB)
134
+ for each subsequent batch. This option can enforce a smaller limit than 16 MiB, but not a larger
135
+ one. If you set ``batchSize`` to a limit that results in batches larger than
136
+ 16 MiB, this option has no effect.
137
+
138
+ | A ``batchSize`` of ``0`` means that the cursor will be established, but no documents
139
+ will be returned in the first batch.
135
140
136
141
* - ``collation(Collation collation)``
137
142
- | Sets the collation options as an instance of the ``Collation`` class.
You can’t perform that action at this time.
0 commit comments