Skip to content
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

DOCSP-47836 clarify batchsize description #96

Merged
merged 6 commits into from
Mar 19, 2025
Merged
Changes from 5 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
10 changes: 8 additions & 2 deletions source/read/change-streams.txt
Original file line number Diff line number Diff line change
@@ -147,8 +147,14 @@ of the watch functions:
- Description

* - ``batchSize``
- | Sets the number of documents to return per batch.

- | The maximum number of documents that a change stream can
return in each batch, which applies to the watch function.
By default, 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 results in batches
larger than 16 MiB, this option has no effect and the watch function uses
the default batch size.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could most of this paragraph be replaced with a link to Cursor Batches instead? e.g. as done for cursor.batchSize() (paraphrased):

The initial number of documents to return for a batch. The default initial batch size is 101 documents. Subsequent batches are 16 mebibytes. For details, see Cursor Batches.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea; I've replaced some of the paragraph, but it is still quite long because I think it's important to call out that you cannot pass in a value for batchSize that will cause the size of the batch to be > 16 MiB, as that's the main confusion that was called out in the ticket as well as the Slack thread that caused the ticket. The cursor.batchSize() page was also mentioned in the parent ticket as a page that needs to be changed as its definition does not state that batchSize can only be limited from 16 MiB and not raised, so I wanted to keep most of the wording to make sure that this functionality is clear.


* - ``comment``
- | Specifies a comment to attach to the operation.