<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:26:15 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>[SERVER-51725] Duplicate documents while using &quot;Sort&quot; with &quot;Pagination&quot;</title>
                <link>https://jira.mongodb.org/browse/SERVER-51725</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When we query MongoDB in below environment with &lt;b&gt;SortByDescending&lt;/b&gt;&#160;and &lt;b&gt;Pagination,&lt;/b&gt;&#160;MongoCSharp driver is &lt;font color=&quot;#FF0000&quot;&gt;&lt;ins&gt;always&lt;/ins&gt;&lt;/font&gt; returning duplicate documents from the second page onwards. We are setting page size as 10.&lt;/p&gt;

&lt;p&gt;Issue is not observed when we remove &lt;b&gt;SortByDescending&lt;/b&gt;&lt;b&gt;.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;ins&gt;Environment with Issue&lt;/ins&gt;&lt;/p&gt;

&lt;p&gt;Server : Windows Server 2016&lt;br/&gt;
mongo db version: 4.4.0&lt;br/&gt;
driver: 2.10.2&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;ins&gt;Environment without Issue&lt;/ins&gt;&lt;/p&gt;

&lt;p&gt;Server : Windows Server 2016&lt;br/&gt;
mongo db version: 4.0.6&lt;br/&gt;
driver: 2.10.2&lt;/p&gt;</description>
                <environment></environment>
        <key id="1518487">SERVER-51725</key>
            <summary>Duplicate documents while using &quot;Sort&quot; with &quot;Pagination&quot;</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="3">Duplicate</resolution>
                                        <assignee username="edwin.zhou@mongodb.com">Edwin Zhou</assignee>
                                    <reporter username="ummerirshadk@gmail.com">Ummer Irshad</reporter>
                        <labels>
                    </labels>
                <created>Mon, 19 Oct 2020 15:03:55 +0000</created>
                <updated>Tue, 15 Dec 2020 21:32:15 +0000</updated>
                            <resolved>Wed, 4 Nov 2020 16:50:31 +0000</resolved>
                                    <version>4.4.0</version>
                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="3475954" author="JIRAUSER1257066" created="Wed, 4 Nov 2020 16:50:31 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ummerirshadk%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;ummerirshadk@gmail.com&quot;&gt;ummerirshadk@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;I&apos;m happy to hear that! I&apos;ll be closing this ticket as a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28195&quot; title=&quot;$skip followed by $limit in aggregation resort &amp;amp; lost records when $sort by equal values&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28195&quot;&gt;&lt;del&gt;SERVER-28195&lt;/del&gt;&lt;/a&gt; now that it&apos;s been resolved.&lt;/p&gt;

&lt;p&gt;Best,&lt;/p&gt;

&lt;p&gt;Edwin&lt;/p&gt;</comment>
                            <comment id="3475140" author="JIRAUSER1257092" created="Wed, 4 Nov 2020 07:49:49 +0000"  >&lt;p&gt;After sorting on unique field (ObjectId) the issue is not reproduced.&#160;Thanks a lot Edwin Zhou.&#160;&lt;/p&gt;</comment>
                            <comment id="3474129" author="JIRAUSER1257066" created="Tue, 3 Nov 2020 17:38:47 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ummerirshadk%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;ummerirshadk@gmail.com&quot;&gt;ummerirshadk@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;We still need additional information to diagnose the problem. If this is still an issue for you, would you please let me know if &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28195&quot; title=&quot;$skip followed by $limit in aggregation resort &amp;amp; lost records when $sort by equal values&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28195&quot;&gt;&lt;del&gt;SERVER-28195&lt;/del&gt;&lt;/a&gt; is representative of your problem? Could you provide a code snippet where this problem occurs so we can understand if this is a driver specific problem? Would you also inform us if the problem persists if you sort on a unique field?&lt;/p&gt;

&lt;p&gt;Best,&lt;/p&gt;

&lt;p&gt;Edwin&lt;/p&gt;</comment>
                            <comment id="3452668" author="JIRAUSER1257066" created="Mon, 19 Oct 2020 19:10:37 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ummerirshadk%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;ummerirshadk@gmail.com&quot;&gt;ummerirshadk@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thank you for reporting this behavior! Could you provide a code snippet where this issue is occurs, and your query result? &lt;br/&gt;
 I suspect this is a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28195&quot; title=&quot;$skip followed by $limit in aggregation resort &amp;amp; lost records when $sort by equal values&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28195&quot;&gt;&lt;del&gt;SERVER-28195&lt;/del&gt;&lt;/a&gt; and this behavior is expected in MongoDB 4.4. Does this ticket describe your issue? &lt;br/&gt;
 This issue usually occurs when sorting on a field that contains multiple of the same value, and using skip and limit. To avoid duplicates, please try sorting on an additional unique field, e.g. _id.&#160;&lt;/p&gt;

&lt;p&gt;Edwin&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="1510789">SERVER-51498</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 19 Oct 2020 17:37:34 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 14 weeks 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>edwin.zhou@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 14 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>edwin.zhou@mongodb.com</customfieldvalue>
            <customfieldvalue>ummerirshadk@gmail.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyddjz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxzmmn:</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_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;&lt;ins&gt;Environment with Issue&lt;/ins&gt;&lt;/p&gt;

&lt;p&gt;Server : Windows Server 2016&lt;br/&gt;
mongo db version: 4.4.0&lt;br/&gt;
driver: 2.10.2&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Step&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Query a collection with more than 50 documents with SortByDescending and Pagination (page size 10)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Result&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Duplicate documents are returned by the driver from second page onwards.&lt;/li&gt;
&lt;/ul&gt;
</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_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[edwin.zhou@mongodb.com]]></customfieldvalue>
    

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hycztb:</customfieldvalue>

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