Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-11947

Docs for SERVER-35989: Mongo shell needs a countDocuments function

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.3, 4.1.2
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      ----------------------------

      Original Description

      Description:

      countDocuments function: returns the number of documents matching the filter
      estimatedDocumentCount function: gets an estimate of the count of documents in a collection using collection metadata

      https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst#count-api-details

      the count() helper is currently deprecated in the drivers, but we have not done so in the shell. There is a ticket for this: https://jira.mongodb.org/browse/SERVER-36436

      Engineering Ticket Description:

      countDocuments was a late change to the drivers for MongoDB 4.0 and is missing from the MongoDB Shell. Needs to be added in a future release.

      ----------------------------

      Description

      Scope of changes (files that need work and how much)

      Add new pages

      • db.collection.countDocuments.txt
      • db.collection.estimatedDocumentCount.txt

      + redirect config/redirects and toc source/includes/ref-toc-method-collection.yaml

      Add references

      • source/core/transactions
      • source/aggregation.
      • source/core/views.txt
      • source/includes/extracts-views.yaml
      • source/reference/command/count.txt
      • source/reference/method/db.collection.count.txt
      • source/reference/operator/aggregation/count.txt

      Impact to other docs outside of this product

      None

      MVP (work and date?)

      Resources (e.g. Scope Docs, Invision)

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              5 years, 29 weeks, 3 days ago