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 descriptions #6292

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

shuangela
Copy link

@shuangela shuangela commented Mar 14, 2025

DESCRIPTION

Updates five pages in manual/reference to clarify how BatchSize works. 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-6292--mongodb-docs.netlify.app/reference/method/cursor.batchSize/
https://deploy-preview-6292--mongodb-docs.netlify.app/reference/command/getMore/
https://deploy-preview-6292--mongodb-docs.netlify.app/reference/command/find/
https://deploy-preview-6292--mongodb-docs.netlify.app/reference/method/db.collection.watch/
https://deploy-preview-6292--mongodb-docs.netlify.app/reference/operator/aggregation/queryStats/#output

JIRA

DOCSP-47795

SELF-REVIEW CHECKLIST

  • Does each file have 3-5 taxonomy facet tags?
    See the taxonomy tagging instructions and this example PR
  • 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 mongodb-docs ready!

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

@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 few questions and 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
Collaborator

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.

Thanks!

If ``batchSize`` is not set, ``getMore`` returns up to 16
mebibytes of data. If ``batchSize`` is set, ``getMore`` returns
the smaller of 16 mebibytes of data or ``batchSize`` documents.
If batchSize is not set, getMore returns up to ``101`` documents in the first batch
Copy link
Collaborator

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 "getMore" in backticks here on line 77.

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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

[behavior question]

Can we clarify what we mean by "no effect" here? I take it that means it uses the default. Thanks!

Copy link
Author

Choose a reason for hiding this comment

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

Yes, it means it will use the default, will clarify!

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
Collaborator

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.

By default, :method:`~db.collection.watch()` 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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

[behavior question]

Can we clarify what we mean by "no effect" here? I take it that means it uses the default.

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

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

Copy link
Collaborator

@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! Would you mind wrapping some of these lines to a shorter width? After that, this one LGTM.

Thanks!
Joe

- Optional. The number of documents to return in the first batch.
Defaults to 101. A batchSize of 0 means that the cursor will be
established, but no documents will be returned in the first batch.
- Optional. The maximum number of documents within each batch returned in a
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would you mind wrapping these lines? Thank you! This applies throughout.

@shuangela
Copy link
Author

@ChrisHarris2012 Thank you for offering to review!

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.

2 participants