<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:05:14 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-12428] [Server] add a blurb about the consequences of using limit() and skip() in one query</title>
                <link>https://jira.mongodb.org/browse/DOCS-12428</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;h2&gt;&lt;a name=&quot;Description&quot;&gt;&lt;/a&gt;Description&lt;/h2&gt;
&lt;p&gt;It appears that it is unclear from our documentation that when &lt;tt&gt;limit()&lt;/tt&gt; and &lt;tt&gt;skip()&lt;/tt&gt; are used in a query, the order of operation will be the same regardless of the order in which limit and skip are arranged and &lt;b&gt;skip will always be first&lt;/b&gt;. &lt;/p&gt;

&lt;p&gt;Could that clarification be added somewhere please? &lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Scopeofchanges&quot;&gt;&lt;/a&gt;Scope of changes&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;Investigate behavior of &lt;tt&gt;cursor.skip&lt;/tt&gt; when chained with other cursor modifiers&lt;/li&gt;
	&lt;li&gt;Document results in &lt;tt&gt;cursor.skip&lt;/tt&gt; page&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Out of scope, but potentially for follow-up : more complete documentation on query plan optimization of cursor modifiers.&lt;/p&gt;</description>
                <environment></environment>
        <key id="684290">DOCS-12428</key>
            <summary>[Server] add a blurb about the consequences of using limit() and skip() in one query</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="13201">Fixed</resolution>
                                        <assignee username="chris.cho@mongodb.com">Christopher Cho</assignee>
                                    <reporter username="yulia.genkina@mongodb.com">Yulia Genkina</reporter>
                        <labels>
                            <label>quick-win</label>
                            <label>reopened</label>
                            <label>server-docs-bug-bash</label>
                    </labels>
                <created>Tue, 5 Feb 2019 20:20:47 +0000</created>
                <updated>Mon, 30 Oct 2023 20:46:36 +0000</updated>
                            <resolved>Mon, 24 Jul 2023 15:26:07 +0000</resolved>
                                                    <fixVersion>Server_Docs_20231030</fixVersion>
                                    <component>manual</component>
                    <component>Server</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="4947970" author="JIRAUSER1264463" created="Wed, 2 Nov 2022 13:58:54 +0000"  >&lt;p&gt;Thanks very much for the detail &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=david.storch%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;david.storch@mongodb.com&quot;&gt;david.storch@mongodb.com&lt;/a&gt;!&lt;/p&gt;</comment>
                            <comment id="4946322" author="david.storch" created="Tue, 1 Nov 2022 22:56:33 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sarah.olson%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;sarah.olson@mongodb.com&quot;&gt;sarah.olson@mongodb.com&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ashley.brown%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;ashley.brown@mongodb.com&quot;&gt;ashley.brown@mongodb.com&lt;/a&gt; this still seems worth doing to me. I could easily imagine a user thinking that &lt;tt&gt;.skip().limit()&lt;/tt&gt; has a different meaning from &lt;tt&gt;.limit().skip()&lt;/tt&gt;, when in fact these two uses of mongosh have the exact same meaning. I&apos;m reopening this ticket.&lt;/p&gt;</comment>
                            <comment id="4940504" author="edu.bot" created="Mon, 31 Oct 2022 16:06:22 +0000"  >&lt;p&gt;Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!&lt;/p&gt;</comment>
                            <comment id="2140142" author="justin.seyster" created="Wed, 6 Feb 2019 18:58:47 +0000"  >&lt;p&gt;It is definitely true that the order of skip() and limit() don&apos;t affect the outcome and execution of the query. These functions only set their respective parameters in the underlying &lt;a href=&quot;https://docs.mongodb.com/manual/reference/command/find/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;find command&lt;/a&gt;.&#160;The query&#160;planner treats these parameters as an unordered set, so it&apos;s not actually possible to specify an order for them.&lt;/p&gt;

&lt;p&gt;A skip will be ordered to the front in the sense that a query with skip &lt;em&gt;n&lt;/em&gt; and limit &lt;em&gt;m&lt;/em&gt; will output &lt;em&gt;m&lt;/em&gt; documents and not (&lt;em&gt;m&lt;/em&gt; - &lt;em&gt;n&lt;/em&gt;) documents (assuming the query returns &amp;gt;= &lt;em&gt;m&lt;/em&gt; documents) and in the sense that the optimizer will attempt to skip documents before fetching them for better performance.&lt;/p&gt;

&lt;p&gt;In my opinion, talking about the various query parameters in terms of their order may actually be more confusing to users. I think it&apos;s better to discuss the effect they have on the query and to clarify how pairs of parameters may interact with each other when it&apos;s ambiguous.&lt;/p&gt;

&lt;p&gt;(None of this applies to aggregation, where the order of $skip and $limit stages directly affects the output from the pipeline.)&lt;/p&gt;</comment>
                            <comment id="2139071" author="david.storch" created="Wed, 6 Feb 2019 00:12:16 +0000"  >&lt;p&gt;Perhaps &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=justin.seyster&quot; class=&quot;user-hover&quot; rel=&quot;justin.seyster&quot;&gt;justin.seyster&lt;/a&gt; could help to clarify?&lt;/p&gt;</comment>
                            <comment id="2138775" author="ravind.kumar" created="Tue, 5 Feb 2019 20:30:18 +0000"  >&lt;p&gt;This kind of feels like it falls into the same sort of category as our docs on &lt;a href=&quot;https://docs.mongodb.com/manual/core/aggregation-pipeline-optimization/#pipeline-sequence-optimization&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;aggregation pipeline optimization&lt;/a&gt; , but for CRUD. We also don&apos;t talk about $skip much. &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=david.storch%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;david.storch@mongodb.com&quot;&gt;david.storch@mongodb.com&lt;/a&gt; can you recommend someone to talk to about potentially mapping out how the query planner reorders cursor modifiers? For the short term we can just talk about &lt;tt&gt;cursor.skip&lt;/tt&gt; and how it interacts with other cursor methods (i&apos;m hoping it&apos;s generally reordered to the front). &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>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_14258" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>Baseline start date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 11 Jul 2023 00:00:00 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 5 Feb 2019 20:30:18 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 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>emet.ozar@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 14 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>chris.cho@mongodb.com</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>edu.bot</customfieldvalue>
            <customfieldvalue>justin.seyster@mongodb.com</customfieldvalue>
            <customfieldvalue>ravind.kumar</customfieldvalue>
            <customfieldvalue>sarah.olson@mongodb.com</customfieldvalue>
            <customfieldvalue>yulia.genkina@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hulbd3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hub5vr:</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|hukxmf:</customfieldvalue>

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