<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:40:50 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-16365] Compound index creation does not follow the order we specifiy</title>
                <link>https://jira.mongodb.org/browse/SERVER-16365</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When we create a compound index specifying a certain order of fields the order is reversed when the index is created.&lt;/p&gt;</description>
                <environment></environment>
        <key id="171953">SERVER-16365</key>
            <summary>Compound index creation does not follow the order we specifiy</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="-1">Unassigned</assignee>
                                    <reporter username="dcsjaj">Arun Devaraj</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Dec 2014 18:05:19 +0000</created>
                <updated>Sun, 11 Jan 2015 20:18:28 +0000</updated>
                            <resolved>Tue, 2 Dec 2014 23:48:25 +0000</resolved>
                                    <version>2.6.0</version>
                                                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="776996" author="rassi@10gen.com" created="Tue, 2 Dec 2014 23:48:25 +0000"  >&lt;p&gt;This is a known issue with the mongo shell: the shell re-orders elements within documents that contain integers as field names.  See &lt;a href=&quot;https://jira.mongodb.org/browse/MONGOSH-1037&quot; title=&quot;Numeric field are sorted to the front (js shell)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MONGOSH-1037&quot;&gt;&lt;del&gt;SERVER-11358&lt;/del&gt;&lt;/a&gt;, and the tickets linked therein.&lt;/p&gt;

&lt;p&gt;I would advise that you modify your schema such that your documents do not contain integers as field names.  Aside from this issue, you may also encounter unintuitive behavior when projecting subdocuments with these fields (see &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-15013?focusedCommentId=707099&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-707099&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;comment at SERVER-15013&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;As an alternative, you can work around this issue by creating the index using a MongoDB driver instead of the mongo shell.  See PyMongo&apos;s &lt;a href=&quot;http://api.mongodb.org/python/current/api/pymongo/collection.html#pymongo.collection.Collection.create_index&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;create_index()&lt;/a&gt; function, as an example.&lt;/p&gt;</comment>
                            <comment id="776980" author="dcsjaj" created="Tue, 2 Dec 2014 23:26:06 +0000"  >&lt;p&gt;Looks like I have an idea on what is happening. If the keys in a compound index have string and numeric values the order is reversed in the index.&lt;br/&gt;
You can repro it without any data in the collection. Here is the output you requested ( ClassId  is represented by the key &quot;Cid&quot;, ModifiedDate date by the key &quot;3&quot;)&lt;/p&gt;

&lt;p&gt;&amp;gt; use Rescore&lt;br/&gt;
switched to db Rescore&lt;br/&gt;
&amp;gt; db.Collection1.ensureIndex(&lt;/p&gt;
{&quot;Cid&quot;:1,&quot;3&quot;:1}
&lt;p&gt;)&lt;br/&gt;
{&lt;br/&gt;
        &quot;createdCollectionAutomatically&quot; : true,&lt;br/&gt;
        &quot;numIndexesBefore&quot; : 1,&lt;br/&gt;
        &quot;numIndexesAfter&quot; : 2,&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; db.Collection1.getIndexes()&lt;br/&gt;
[&lt;br/&gt;
        {&lt;br/&gt;
                &quot;v&quot; : 1,&lt;br/&gt;
                &quot;key&quot; : &lt;/p&gt;
{
                        &quot;_id&quot; : 1
                }
&lt;p&gt;,&lt;br/&gt;
                &quot;name&quot; : &quot;&lt;em&gt;id&lt;/em&gt;&quot;,&lt;br/&gt;
                &quot;ns&quot; : &quot;Rescore.Collection1&quot;&lt;br/&gt;
        },&lt;br/&gt;
        {&lt;br/&gt;
                &quot;v&quot; : 1,&lt;br/&gt;
                &quot;key&quot; : &lt;/p&gt;
{
                        &quot;3&quot; : 1,
                        &quot;Cid&quot; : 1
                }
&lt;p&gt;,&lt;br/&gt;
                &quot;name&quot; : &quot;3_1_Cid_1&quot;,&lt;br/&gt;
                &quot;ns&quot; : &quot;Rescore.Collection1&quot;&lt;br/&gt;
        }&lt;br/&gt;
]&lt;br/&gt;
&amp;gt; db.Collection1.stats()&lt;br/&gt;
{&lt;br/&gt;
        &quot;ns&quot; : &quot;Rescore.Collection1&quot;,&lt;br/&gt;
        &quot;count&quot; : 0,&lt;br/&gt;
        &quot;size&quot; : 0,&lt;br/&gt;
        &quot;numExtents&quot; : 1,&lt;br/&gt;
        &quot;storageSize&quot; : 8192,&lt;br/&gt;
        &quot;nindexes&quot; : 2,&lt;br/&gt;
        &quot;lastExtentSize&quot; : 8192,&lt;br/&gt;
        &quot;paddingFactor&quot; : 1,&lt;br/&gt;
        &quot;paddingFactorNote&quot; : &quot;paddingFactor is unused and unmaintained in 2.8.&lt;br/&gt;
It remains hard coded to 1.0 for compatibility only.&quot;,&lt;br/&gt;
        &quot;userFlags&quot; : 1,&lt;br/&gt;
        &quot;totalIndexSize&quot; : 16352,&lt;br/&gt;
        &quot;indexSizes&quot; : &lt;/p&gt;
{
                &quot;_id_&quot; : 8176,
                &quot;3_1_Cid_1&quot; : 8176
        }
&lt;p&gt;,&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;br/&gt;
&amp;gt;&lt;/p&gt;
</comment>
                            <comment id="775397" author="rassi@10gen.com" created="Mon, 1 Dec 2014 19:43:52 +0000"  >&lt;p&gt;Please post the verbatim output of running the following at the mongo shell:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.collection1.ensureIndex({ClassId:1, ModifiedDate:1})&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.collection1.getIndexes()&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.collection1.stats()&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;And, does the issue persist after restarting the shell?&lt;/p&gt;</comment>
                            <comment id="775375" author="dcsjaj" created="Mon, 1 Dec 2014 19:32:39 +0000"  >&lt;p&gt;I am using the MongoDb shell for index creation.&lt;/p&gt;</comment>
                            <comment id="775324" author="rassi@10gen.com" created="Mon, 1 Dec 2014 18:41:59 +0000"  >&lt;p&gt;Are you creating this index using the mongo shell, or are you using the ensureIndex() method from a MongoDB driver?  If the latter, which driver are you using?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="95651">MONGOSH-1037</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 1 Dec 2014 18:41:59 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 11 weeks, 1 day 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>dan@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 11 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[Windows]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>dcsjaj</customfieldvalue>
            <customfieldvalue>rassi</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrlhon:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>150595</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;1. Create a compound index-&lt;br/&gt;
    db.collection1.ensureIndex(&lt;/p&gt;
{&quot;ClassId&quot;:1,&quot;ModifiedDate&quot;:1}
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;2. After index is created, run collection1.stats() to look at the index created.&lt;br/&gt;
You see &quot;ModifiedDate_1_ClassId_1&quot; instead of &quot;ClassId_1_ModifiedDate_1&quot;&lt;/p&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>
                                

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

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