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-47795] Change batchsize description #392

Merged

Conversation

shuangela
Copy link
Contributor

@shuangela shuangela commented Mar 14, 2025

DESCRIPTION

Updates the reference/methods page to clarify how BatchSize works. Related to the batchsize pr in the docs repo. No new sections were added, but descriptions of BatchSize were changed.

Wording taken from already updated PHP driver docs which was approved by a PHP engineer.

STAGING

https://deploy-preview-392--docs-mongodb-shell.netlify.app/reference/methods/#cursor-methods

JIRA

https://jira.mongodb.org/browse/DOCSP-47795

BUILD LOG

https://app.netlify.com/sites/docs-mongodb-shell/deploys/67d4525e66989c0008faf1e8

Self-Review Checklist

  • Is this free of any warnings or errors in the RST?
  • Is this free of spelling errors?
  • Is this free of grammatical errors?
  • Is this free of staging / rendering issues?
  • Are all the links working?

External Review Requirements

What's expected of an external reviewer?

Copy link

netlify bot commented Mar 14, 2025

Deploy Preview for docs-mongodb-shell ready!

Name Link
🔨 Latest commit fa0495d
🔍 Latest deploy log https://app.netlify.com/sites/docs-mongodb-shell/deploys/67f54c4590f69000086a2871
😎 Deploy Preview https://deploy-preview-392--docs-mongodb-shell.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
Contributor

@jmd-mongo jmd-mongo left a comment

Choose a reason for hiding this comment

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

Thanks for these updates, @shuangela! I've left a question and some suggestions for your consideration.

Thanks!
Joe

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
Copy link
Contributor

Choose a reason for hiding this comment

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

[style suggestion]

Consider wrapping "batchSize" and "0" in backticks here on line 507.

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
Copy link
Contributor

Choose a reason for hiding this comment

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

[tense suggestion]

Consider updating this to use the present tense. Spitballing:

A ``batchsize`` of ``0`` means that the cursor is established, but no documents 
are returned in the first batch.

@shuangela shuangela requested a review from jmd-mongo March 14, 2025 19:48
@shuangela
Copy link
Contributor Author

Thanks for the review, @jmd-mongo! Addressed your feedback and applied it to other pages as well, back to you!

Copy link
Contributor

@jmd-mongo jmd-mongo left a comment

Choose a reason for hiding this comment

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

Thanks, @shuangela! This one LGTM mod a tiny nit.

Thanks,
Joe

size is ``101`` documents and subsequent batches have a maximum
size of 16 mebibytes (MiB). 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 :method:`~cursor.batchSize()` uses the default batch size.
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit]

Would you mind wrapping this line at col 72? Thanks!

@shuangela
Copy link
Contributor Author

@ChrisHarris2012 Thank you for offering to review!

Copy link

@ChrisHarris2012 ChrisHarris2012 left a comment

Choose a reason for hiding this comment

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

Not major concerns, but a couple thoughts to consider

@@ -497,8 +497,17 @@ Cursor Methods
.. arrayAccess

* - :method:`cursor.batchSize()`
- Controls the number of documents MongoDB will return to the
client in a single network message.
- Specifies the maximum number of documents MongoDB will return to the

Choose a reason for hiding this comment

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

How about "can" instead of will? Feels like it aligns better with the interaction with the concurrent size limit

Comment on lines 506 to 507
has no effect and :method:`~cursor.batchSize()` uses the default
batch size.

Choose a reason for hiding this comment

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

'default batch size' here feels... undefined? In general I liked the wording in the other PR about how the batch sizes end up being 'the lesser of the two'

Copy link

@ChrisHarris2012 ChrisHarris2012 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@jmd-mongo jmd-mongo merged commit bd6d308 into mongodb:master Apr 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants