<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 07:57:37 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[DOCS-9121] db.collection.count documentation unclear on accuracy</title>
                <link>https://jira.mongodb.org/browse/DOCS-9121</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://docs.mongodb.com/master/reference/method/db.collection.count/#behavior&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/master/reference/method/db.collection.count/#behavior&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This page suggests that db.collection.count() can be inaccurate when run against a sharded cluster,&lt;/p&gt;

&lt;p&gt;However, if a query predicate is supplied, and the query is run via a mongoS, the count() will be accurate.&lt;/p&gt;

&lt;p&gt;Please amend, for example by adding a note similar to the one below for &quot;Accuracy after Unexpected Shutdown&quot;. Or by changing the wording to something along the lines of &quot;On a sharded cluster, count() &lt;b&gt;without a query clause&lt;/b&gt; can result in an inaccurate count if orphaned documents exist or if a chunk migration is in progress.&quot;&lt;/p&gt;</description>
                <environment></environment>
        <key id="322350">DOCS-9121</key>
            <summary>db.collection.count documentation unclear on accuracy</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="ravind.kumar">Ravind Kumar</assignee>
                                    <reporter username="john.murphy@mongodb.com">John Murphy</reporter>
                        <labels>
                    </labels>
                <created>Mon, 10 Oct 2016 06:53:27 +0000</created>
                <updated>Mon, 30 Oct 2023 21:23:39 +0000</updated>
                            <resolved>Tue, 8 Aug 2017 01:47:24 +0000</resolved>
                                    <version>3.4.0</version>
                                    <fixVersion>Server_Docs_20231030</fixVersion>
                                    <component>manual</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="1642539" author="john.murphy" created="Tue, 8 Aug 2017 01:47:24 +0000"  >&lt;p&gt;Thanks all for the research into this one, I will await the results of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3645&quot; title=&quot;Sharded collection counts (on primary) can report too many results&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3645&quot;&gt;&lt;del&gt;SERVER-3645&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="1642106" author="ravind.kumar" created="Mon, 7 Aug 2017 17:23:50 +0000"  >&lt;p&gt;Thanks all - from what I&apos;m gathering, the documentation is true as it stands. &lt;/p&gt;

&lt;p&gt;Cheers. &lt;/p&gt;</comment>
                            <comment id="1634018" author="david.storch" created="Thu, 27 Jul 2017 22:35:29 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=renctan&quot; class=&quot;user-hover&quot; rel=&quot;renctan&quot;&gt;renctan&lt;/a&gt;, that&apos;s correct, count plans still do not include the shard filter stage. This is tracked by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3645&quot; title=&quot;Sharded collection counts (on primary) can report too many results&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3645&quot;&gt;&lt;del&gt;SERVER-3645&lt;/del&gt;&lt;/a&gt;. Although this would be an easy fix in the case that the count command has a predicate, we still use a &quot;fast count&quot; when there is no predicate---meaning that we just read storage engine metadata to obtain the record count. This behavior makes it difficult for the count command to behave correctly in a sharded environment in &lt;em&gt;all&lt;/em&gt; cases. Furthermore, I believe the WiredTiger record count metadata can sometimes be inaccurate, although you&apos;d have to ask the storage team for the current state of that problem.&lt;/p&gt;</comment>
                            <comment id="1633661" author="renctan" created="Thu, 27 Jul 2017 17:31:10 +0000"  >&lt;p&gt;After a quick look at the current code in master, it looks like the shard filter stage is still not included in the count command. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=david.storch&quot; class=&quot;user-hover&quot; rel=&quot;david.storch&quot;&gt;david.storch&lt;/a&gt;, can you confirm that it is the case? In addition, secondaries don&apos;t keep track of sharding metadata as of v3.4 (this will change in v3.6 with safe secondary reads project), so there is no easy way for it to filter out orphan documents.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[500A000000XWO9XIAX]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 11 Oct 2016 13:20:37 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 27 weeks, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>emet.ozar@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 27 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>john.murphy@mongodb.com</customfieldvalue>
            <customfieldvalue>randolph@mongodb.com</customfieldvalue>
            <customfieldvalue>ravind.kumar</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmeyv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsqnkv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrzdrz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                </customfields>
    </item>
</channel>
</rss>