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:
163163
164164 * - ``batchSize()``
165165 - | 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.
167174
168175 * - ``collation()``
169176 - | 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.
2929
3030In the {+driver-short+}, some streams are backed by cursors. The size of batches used
3131in 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
3333using the ``FindPublisher.batchSize()`` method.
3434
3535Sample 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
113113 - Description
114114
115115 * - ``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.
117122
118123 * - ``collation()``
119124 - | 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:
129129 - Description
130130
131131 * - ``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.
135140
136141 * - ``collation(Collation collation)``
137142 - | Sets the collation options as an instance of the ``Collation`` class.
You can’t perform that action at this time.
0 commit comments