<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 07:57:41 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-9153] Clarify sort order for compound indexes on Use Indexes to Sort Query Results</title>
                <link>https://jira.mongodb.org/browse/DOCS-9153</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;h5&gt;&lt;a name=&quot;Submitter%27sComment&quot;&gt;&lt;/a&gt;Submitter&apos;s Comment&lt;/h5&gt;

&lt;p&gt;The rule of sort order about compound indexes on this page is opposit with &lt;a href=&quot;https://docs.mongodb.com/manual/tutorial/sort-results-with-indexes/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/tutorial/sort-results-with-indexes/&lt;/a&gt;. Latter one  says &quot;The sort must specify the same sort direction (i.e.ascending/descending) for all its keys as the index key pattern or specify the reverse sort direction for all its keys as the index key pattern&quot;.&lt;/p&gt;

&lt;h5&gt;&lt;a name=&quot;GroomingDescription&quot;&gt;&lt;/a&gt;Grooming Description&lt;/h5&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.mongodb.com/manual/tutorial/sort-results-with-indexes/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Use Indexes to Sort Query Results&lt;/a&gt; states the following:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;The sort must specify the same sort direction (i.e.ascending/descending) for all its keys as the index key pattern&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;If one is reading quickly, it&apos;s easy to miss the &lt;em&gt;as the index key pattern&lt;/em&gt; and conclude that when sorting, compound indexes support only {&lt;tt&gt;a:1, b:1&lt;/tt&gt;} indexes, but not {&lt;tt&gt;a:1, b:-1&lt;/tt&gt;} (&quot;the sort must specify the same sort direction for all its keys&quot;). We should rephrase this to better explain what we&apos;re actually trying to explain. &lt;/p&gt;

&lt;p&gt;I&apos;ve taken a stab at doing so my below reply to the original submitter.&lt;/p&gt;</description>
                <environment>&lt;br/&gt;
&lt;br/&gt;
*Location*: &lt;a href=&quot;https://docs.mongodb.com/manual/core/index-compound/&quot;&gt;https://docs.mongodb.com/manual/core/index-compound/&lt;/a&gt;&lt;br/&gt;
*User-Agent*: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0&lt;br/&gt;
*Referrer*: &lt;a href=&quot;https://docs.mongodb.com/manual/core/index-single/&quot;&gt;https://docs.mongodb.com/manual/core/index-single/&lt;/a&gt;&lt;br/&gt;
*Screen Resolution*: 1920 x 1080&lt;br/&gt;
</environment>
        <key id="324108">DOCS-9153</key>
            <summary>Clarify sort order for compound indexes on Use Indexes to Sort Query Results</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="allison.moore@mongodb.com">Allison Reinheimer Moore</assignee>
                                    <reporter username="xgen-internal-docs">Docs Collector User</reporter>
                        <labels>
                            <label>collector-298ba4e7</label>
                    </labels>
                <created>Mon, 17 Oct 2016 09:03:52 +0000</created>
                <updated>Mon, 24 Oct 2016 15:50:34 +0000</updated>
                            <resolved>Mon, 24 Oct 2016 15:50:12 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1415761" author="xgen-internal-githook" created="Mon, 24 Oct 2016 15:49:07 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;schmalliso&apos;, u&apos;name&apos;: u&apos;Allison Moore&apos;, u&apos;email&apos;: u&apos;allison.moore@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-9153&quot; title=&quot;Clarify sort order for compound indexes on Use Indexes to Sort Query Results&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-9153&quot;&gt;&lt;del&gt;DOCS-9153&lt;/del&gt;&lt;/a&gt;: rephrases sort order for compound indexes&lt;br/&gt;
Branch: v3.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/c05c99021c2f5835c2b919485de99bcff9efb2aa&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/c05c99021c2f5835c2b919485de99bcff9efb2aa&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1415758" author="xgen-internal-githook" created="Mon, 24 Oct 2016 15:48:34 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;schmalliso&apos;, u&apos;name&apos;: u&apos;Allison Moore&apos;, u&apos;email&apos;: u&apos;allison.moore@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-9153&quot; title=&quot;Clarify sort order for compound indexes on Use Indexes to Sort Query Results&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-9153&quot;&gt;&lt;del&gt;DOCS-9153&lt;/del&gt;&lt;/a&gt;: rephrases sort order for compound indexes&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/3b1bb860c67aa48d69ffd036d32f37def38073c7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/3b1bb860c67aa48d69ffd036d32f37def38073c7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1410008" author="allison.moore@10gen.com" created="Mon, 17 Oct 2016 12:53:39 +0000"  >&lt;p&gt;Hello!&lt;/p&gt;

&lt;p&gt;Thanks so much for bringing this to our attention! The wording on the Use Indexes to Sort Query Results page that you quote is, indeed, confusing. We&apos;ll be sure to update that.&lt;/p&gt;

&lt;p&gt;What we&apos;re &lt;em&gt;trying&lt;/em&gt; to say is that a compound index with pattern {&lt;tt&gt;a:1, b:-1&lt;/tt&gt;} can support sorting on the same sort direction: {&lt;tt&gt;a:1, b:-1&lt;/tt&gt;}, &lt;b&gt;and&lt;/b&gt; the reverse direction: {&lt;tt&gt;a:-1, b:1&lt;/tt&gt;}, but could &lt;b&gt;not&lt;/b&gt; support sorting on {&lt;tt&gt;a:1, b:1&lt;/tt&gt;} or {&lt;tt&gt;a:-1, b:-1&lt;/tt&gt;}.&lt;/p&gt;

&lt;p&gt;So, in short, what it says on the Compound Indexes page is correct and we&apos;ve explained the concept poorly on the Use Indexes to Sort Query Results page. We&apos;ll update the page to clarify.&lt;/p&gt;


&lt;p&gt;Thanks so much!&lt;br/&gt;
Allison&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>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 17 Oct 2016 12:10:50 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 16 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>allison.moore@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-docs</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmem7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsqwlb:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="1324">KANBAN BUCKET</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.25</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|hrzfav:</customfieldvalue>

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