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

db.collection.count documentation unclear on accuracy

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • 3.4.0
    • manual
    • None

    Description

      https://docs.mongodb.com/master/reference/method/db.collection.count/#behavior

      This page suggests that db.collection.count() can be inaccurate when run against a sharded cluster,

      However, if a query predicate is supplied, and the query is run via a mongoS, the count() will be accurate.

      Please amend, for example by adding a note similar to the one below for "Accuracy after Unexpected Shutdown". Or by changing the wording to something along the lines of "On a sharded cluster, count() without a query clause can result in an inaccurate count if orphaned documents exist or if a chunk migration is in progress."

      Attachments

        Activity

          People

            ravind.kumar Ravind Kumar (Inactive)
            john.murphy@mongodb.com John Murphy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              6 years, 27 weeks, 2 days ago