Skip to content

[Backport v2.28] DOCSP-47834 clarify batch size #531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions source/fundamentals/crud/read-operations/change-streams.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,16 @@ of ``Watch()`` and ``WatchAsync()``:
include expanded events in a change stream, create the change stream
cursor and set this parameter to ``True``.

* - ``BatchSize``
- | Specifies the maximum number of change events to return in each batch of the
response from the MongoDB cluster.
* - ``batchSize``
- | Specifies the maximum number of documents that a change
stream can return in each batch, which applies to ``Watch()`` or
``WatchAsync()``. If the ``batchSize`` option is not set, watch functions have an
initial batch size of ``101`` documents and a maximum size of 16 mebibytes (MiB)
for each subsequent batch. This option can
enforce a smaller limit than 16 MiB, but not a larger one. If
you set ``batchSize`` to a limit that result in batches
larger than 16 MiB, this option has no effect and ``Watch()``
or ``WatchAsync()`` uses the default batch size.

* - ``Collation``
- | Specifies the collation to use for the change stream cursor.
Expand Down
8 changes: 7 additions & 1 deletion source/fundamentals/crud/read-operations/retrieve.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,13 @@ You can configure the commonly used options with the following methods:
- Description

* - ``BatchSize``
- | Gets or sets the number of documents to hold in a cursor at a given time.
- | Gets or sets the maximum number of documents within each
batch returned in a query result. If ``batchSize`` is not set, the ``Find()``
method has an initial batch size of ``101`` documents and a maximum size of 16
mebibytes (MiB) for each subsequent batch. This option can enforce a smaller
limit than 16 MiB, but not a larger one. If you set ``batchSize`` to a limit that
results in batches larger than 16 MiB, this option has no effect and the
``Find()`` method uses the default batch size.

* - ``Collation``
- | Sets the collation options.
Expand Down