diff --git a/source/read/change-streams.txt b/source/read/change-streams.txt index 5291432..3fa9795 100644 --- a/source/read/change-streams.txt +++ b/source/read/change-streams.txt @@ -163,7 +163,14 @@ customize its behavior: * - ``batchSize()`` - | Specifies the maximum number of change events to return in each batch of the - response from the MongoDB cluster. + response from the MongoDB cluster. By default, returns 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. + + | A ``batchSize`` of ``0`` means that the cursor will be established, but no documents + will be returned in the first batch. * - ``collation()`` - | Specifies the collation to use for the change stream cursor. diff --git a/source/read/cursors.txt b/source/read/cursors.txt index 5b2f1af..3f77f8b 100644 --- a/source/read/cursors.txt +++ b/source/read/cursors.txt @@ -29,7 +29,7 @@ cursors reduce both memory consumption and network bandwidth usage. In the {+driver-short+}, some streams are backed by cursors. The size of batches used in these underlying cursors depends on the demand requested on the ``Subscription`` for the -``Publisher``. The batch size of data contained by each underlying cursor can be set by +``Publisher``. You can set the batch size of data contained by each underlying cursor by using the ``FindPublisher.batchSize()`` method. Sample Data diff --git a/source/read/distinct.txt b/source/read/distinct.txt index 3dc80af..ff4d9cd 100644 --- a/source/read/distinct.txt +++ b/source/read/distinct.txt @@ -113,7 +113,12 @@ The following table describes some methods you can use to customize the - Description * - ``batchSize()`` - - | Sets the number of documents to return per batch. + - | Sets the number of documents to return per batch. By default, returns 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. + + | A ``batchSize`` of ``0`` means that the cursor will be established, but no documents + will be returned in the first batch. * - ``collation()`` - | Specifies the kind of language collation to use when sorting diff --git a/source/read/retrieve-data.txt b/source/read/retrieve-data.txt index 386fb59..68cb367 100644 --- a/source/read/retrieve-data.txt +++ b/source/read/retrieve-data.txt @@ -129,9 +129,14 @@ to it. The following table describes commonly used methods: - Description * - ``batchSize(int batchSize)`` - - | Limits the number of documents to hold in a cursor at a given time. To - learn more about cursors, see :manual:`cursor - ` in the MongoDB Server documentation. + - | The maximum number of documents within each batch returned in a query result. By default, the ``find`` + command 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. + + | A ``batchSize`` of ``0`` means that the cursor will be established, but no documents + will be returned in the first batch. * - ``collation(Collation collation)`` - | Sets the collation options as an instance of the ``Collation`` class.