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-41137: Count Documents #4

Merged
merged 12 commits into from
Jul 10, 2024

Conversation

mcmorisi
Copy link
Collaborator

@mcmorisi mcmorisi commented Jul 9, 2024

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-41137
Staging - https://preview-mongodbmcmorisi.gatsbyjs.io/kotlin-sync/DOCSP-41137-count-docs/read/count/

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 Jul 9, 2024

Deploy Preview for docs-kotlin-sync ready!

Name Link
🔨 Latest commit e0e807a
🔍 Latest deploy log https://app.netlify.com/sites/docs-kotlin-sync/deploys/668e9b6edf604d0008a1f5b9
😎 Deploy Preview https://deploy-preview-4--docs-kotlin-sync.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.

Nice work! Added some suggestions / questions

source/read.txt Outdated
.. TODO: To learn more about the ``count_documents()`` method, see the
.. :ref:`kotlin-sync-accurate-count` guide.
To learn more about the ``countDocuments()`` method, see the
:ref:`kotlin-sync-accurate-count` guide.
Copy link
Collaborator

Choose a reason for hiding this comment

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

S: since you're linking to a section within the Count Documents guide, I'd reword to something like:

Suggested change
:ref:`kotlin-sync-accurate-count` guide.
:ref:`kotlin-sync-accurate-count` section of the Count Documents guide.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Applies to the two links below as well

number of documents in a collection.

.. _kotlin-sync-accurate-count:

Copy link
Collaborator

Choose a reason for hiding this comment

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

S: not necessary, but it might be helpful to use one of the Atlas sample datasets for the code examples on this page and introduce it here (similar to the C++ count documents page). This could help make the current code examples a little more specific and would provide an output


* - ``hint``
- | Gets or sets the index to scan for documents.

Copy link
Collaborator

Choose a reason for hiding this comment

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

S: I think it would be helpful to add a code example here that passes an options argument

Comment on lines 86 to 87
* - ``collection``
- | An instance of ``Collation``.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: should this say "collation" instead of "collection"? Also, you could make the description a little more specific:

Suggested change
* - ``collection``
- | An instance of ``Collation``.
* - ``collection``
- | The collation to use for the operation.

~~~~~~~~~~~~~~~~~~~~~~~~

The ``countDocuments()`` method accepts optional parameters in the form of a
``CountOptions`` object, which represents options you can use to configure the count
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: how do you set these options - by specifying fields of a CountOptions object? Might be good to clarify that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can add some clarifying wording.

Comment on lines 97 to 98
You can get an estimate of the number of documents in a collection by calling
the ``estimatedDocumentCount()`` method. The method estimates the amount of
Copy link
Collaborator

Choose a reason for hiding this comment

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

S: to match the syntax of the accurate count section:

Suggested change
You can get an estimate of the number of documents in a collection by calling
the ``estimatedDocumentCount()`` method. The method estimates the amount of
Use the ``estimatedDocumentCount()`` method to retrieve an estimate of the number of documents in a collection. The method estimates the amount of

:widths: 30 70
:header-rows: 1

* - Property
Copy link
Collaborator

Choose a reason for hiding this comment

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

S: "Field" or "Option" might be better words than "Property" here

@mcmorisi mcmorisi requested a review from norareidy July 10, 2024 13:40
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 + one small suggestion


To return a count of documents that match specific search criteria, specify your query
in the ``countDocuments()`` method. The following example prints a count of all documents
in the ``movies`` collection with a ``year`` field value equal to ``1930``:
Copy link
Collaborator

Choose a reason for hiding this comment

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

S: to avoid "with":

Suggested change
in the ``movies`` collection with a ``year`` field value equal to ``1930``:
in the ``movies`` collection that have a ``year`` field value equal to ``1930``:

@mcmorisi mcmorisi merged commit b9a7270 into mongodb:master Jul 10, 2024
0 of 2 checks passed
@mcmorisi mcmorisi deleted the DOCSP-41137-count-docs branch July 10, 2024 14:33
mcmorisi added a commit that referenced this pull request Jul 10, 2024
(cherry picked from commit b9a7270)
mcmorisi added a commit that referenced this pull request Jul 10, 2024
(cherry picked from commit b9a7270)
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