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

db.collection.count documentation unclear on accuracy

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: 3.4.0
    • Component/s: manual
    • Labels:
      None

      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."

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

              Created:
              Updated:
              Resolved:
              6 years, 38 weeks, 3 days ago