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

Conversation

shuangela
Copy link
Collaborator

@shuangela shuangela commented Mar 14, 2025

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-47836
Staging - https://deploy-preview-96--docs-c.netlify.app/read/change-streams/#modify-watch-behavior

Self-Review Checklist

  • Is this free of any warnings or errors in the RST?
  • Did you run a spell-check?
  • Did you run a grammar-check?
  • Are all the links working?
  • Are the facets and meta keywords accurate?

Copy link

netlify bot commented Mar 14, 2025

Deploy Preview for docs-c ready!

Name Link
🔨 Latest commit df0be51
🔍 Latest deploy log https://app.netlify.com/sites/docs-c/deploys/67d9d669ce93b600087f8d3a
😎 Deploy Preview https://deploy-preview-96--docs-c.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@norareidy norareidy left a comment

Choose a reason for hiding this comment

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

LGTM + small suggestion!

Comment on lines 150 to 151
- | The maximum number of documents within each batch returned
in a change stream, 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.

S: line 151 looks pretty long, so I'd break it up over a few lines. Also I think this wording for the first sentence is a little more clear / uses active voice:

Suggested change
- | The maximum number of documents within each batch returned
in a change stream, 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.
- | 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.

@shuangela shuangela requested review from a team and eramongodb and removed request for a team March 17, 2025 17:20
Comment on lines 150 to 157
- | 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.

@shuangela shuangela requested a review from eramongodb March 18, 2025 20:29
@shuangela shuangela merged commit 0861f21 into mongodb:master Mar 19, 2025
5 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 19, 2025
* change batchsize description

* nr feedback

* fix wrapping

* wrapping

* Empty-Commit

* tech feedback

(cherry picked from commit 0861f21)
github-actions bot pushed a commit that referenced this pull request Mar 19, 2025
* change batchsize description

* nr feedback

* fix wrapping

* wrapping

* Empty-Commit

* tech feedback

(cherry picked from commit 0861f21)
shuangela added a commit that referenced this pull request Mar 19, 2025
* change batchsize description

* nr feedback

* fix wrapping

* wrapping

* Empty-Commit

* tech feedback

(cherry picked from commit 0861f21)

Co-authored-by: shuangela <[email protected]>
shuangela added a commit that referenced this pull request Mar 19, 2025
* change batchsize description

* nr feedback

* fix wrapping

* wrapping

* Empty-Commit

* tech feedback

(cherry picked from commit 0861f21)

Co-authored-by: shuangela <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants