<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:00:30 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-2598] Curious indexing behavior with arrays</title>
                <link>https://jira.mongodb.org/browse/SERVER-2598</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Queries can return different results depending on whether an index exists or not, when Indexing on lists.&lt;/p&gt;

&lt;p&gt;It is best illustrated with code:&lt;/p&gt;

&lt;p&gt;&amp;gt; db.test.insert(&lt;/p&gt;
{a:[1,1,1]}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.test.insert(&lt;/p&gt;
{a:[1,1,2]}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.test.insert(&lt;/p&gt;
{a:[1,1,3]}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.test.insert(&lt;/p&gt;
{a:[1,2]}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.test.insert(&lt;/p&gt;
{a:[1,2,1]}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.test.insert(&lt;/p&gt;
{a:[2,1]}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.test.insert(&lt;/p&gt;
{a:[3]}
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;&amp;gt; db.test.find(&lt;/p&gt;
{&apos;a.0&apos;:1}
&lt;p&gt;)&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;4d60ceef276d207f24f8c3b2&quot;), &quot;a&quot; : [ 1, 1, 1 ] }
{ &quot;_id&quot; : ObjectId(&quot;4d60cef1276d207f24f8c3b3&quot;), &quot;a&quot; : [ 1, 1, 2 ] }
{ &quot;_id&quot; : ObjectId(&quot;4d60cef2276d207f24f8c3b4&quot;), &quot;a&quot; : [ 1, 1, 3 ] }
{ &quot;_id&quot; : ObjectId(&quot;4d60cef9276d207f24f8c3b5&quot;), &quot;a&quot; : [ 1, 2 ] }
{ &quot;_id&quot; : ObjectId(&quot;4d60cf04276d207f24f8c3b6&quot;), &quot;a&quot; : [ 1, 2, 1 ] }

&lt;p&gt;Unless you add an index:&lt;br/&gt;
&amp;gt; db.test.ensureIndex(&lt;/p&gt;
{&apos;a.0&apos;:1}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.test.find(&lt;/p&gt;
{&apos;a.0&apos;:1}
&lt;p&gt;) &lt;/p&gt;

&lt;p&gt;Same query now returns nothing. Returning nothing is probably what is expected in this case.&lt;/p&gt;</description>
                <environment>Linux Ubuntu 64 bit</environment>
        <key id="14828">SERVER-2598</key>
            <summary>Curious indexing behavior with arrays</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="wladimir">W. van der Laan</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Feb 2011 10:26:54 +0000</created>
                <updated>Wed, 6 Nov 2019 13:36:39 +0000</updated>
                            <resolved>Mon, 26 Nov 2012 00:07:26 +0000</resolved>
                                    <version>1.7.6</version>
                                                    <component>Index Maintenance</component>
                                        <votes>1</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="60369" author="cwestin" created="Thu, 13 Oct 2011 21:27:41 +0000"  >&lt;p&gt;This is almost certainly not working because the index match is looking for a scalar valued field:  {a:{&quot;0&quot;:1}}.  JavaScript is broken in that a.0 is really the same as a&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;; but a:&lt;/p&gt;
{&quot;0&quot;:...}
&lt;p&gt; and a:&lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt; aren&apos;t really the same as far as a user is concerned.  We&apos;ve got similar update bugs where folks try to upsert things with &apos;a.0&apos; in them and end up with a:&lt;/p&gt;
{&quot;0&quot;:&amp;lt;value&amp;gt;}
&lt;p&gt; when they want a new array with their value as the first element.  Perhaps we should just put a stack in the ground here and require the use of &apos;a.0&apos; or &apos;a&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&apos; to explicitly declare the user&apos;s intent in these cases.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="988785">SERVER-44393</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="15477">SERVER-2902</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>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 13 Oct 2011 21:27:41 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 18 weeks, 6 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>benety.goh@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 18 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </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>cwestin</customfieldvalue>
            <customfieldvalue>wladimir</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrp5lj:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>20523</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_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|ht06r3:</customfieldvalue>

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