<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:57:43 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-1678] Query on a field of deep nested arrays and dictionaries don&apos;t find all document </title>
                <link>https://jira.mongodb.org/browse/SERVER-1678</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I&apos;ve got this 3 document in a collection: &lt;a href=&quot;http://pastie.org/1114659&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://pastie.org/1114659&lt;/a&gt; , and I have these query objects: &lt;/p&gt;
{&apos;fields.5.3.0&apos;: 31}
&lt;p&gt; &#160; &#160; (n&#186;1)&lt;/p&gt;
{&apos;fields.5.6.0&apos;: 31}
&lt;p&gt; &#160; &#160; (n&#186;2)&lt;br/&gt;
The first two document differs only in the name of a key (I changed it from &quot;3&quot; to &quot;6&quot;), and the third is like the first only with one nested dictionary less.&lt;br/&gt;
Obviously, the query n&#186;1 should match the 1st and the 3rd document, and the n&#186;2 should match the 2nd document, but:&lt;br/&gt;
&amp;gt; db.bug.find(&lt;/p&gt;
{&apos;fields.5.3.0&apos;: 31}
&lt;p&gt;).count()&lt;br/&gt;
1&lt;br/&gt;
(instead of 2)	&lt;br/&gt;
&amp;gt; db.bug.find(&lt;/p&gt;
{&apos;fields.5.6.0&apos;: 31}
&lt;p&gt;).count()&lt;br/&gt;
1&lt;br/&gt;
(it seems corrent)&lt;/p&gt;

&lt;p&gt;Am I mistaking somewhere?&lt;/p&gt;</description>
                <environment></environment>
        <key id="12908">SERVER-1678</key>
            <summary>Query on a field of deep nested arrays and dictionaries don&apos;t find all document </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="9">Done</resolution>
                                        <assignee username="mathias@mongodb.com">Mathias Stearn</assignee>
                                    <reporter username="kosii">kosii</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Aug 2010 12:06:55 +0000</created>
                <updated>Fri, 7 Mar 2014 00:57:13 +0000</updated>
                            <resolved>Tue, 31 Aug 2010 19:59:59 +0000</resolved>
                                    <version>1.6.1</version>
                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="17604" author="kosii" created="Tue, 31 Aug 2010 08:37:48 +0000"  >&lt;p&gt;Ok, thank you.&lt;/p&gt;</comment>
                            <comment id="17514" author="redbeard0531" created="Sat, 28 Aug 2010 01:05:34 +0000"  >&lt;p&gt;I think I found the cause. The issue is that for one of the objects it takes the &apos;3&apos; in your query to be an index into the array. Take a look at the output from these calls: &lt;/p&gt;

&lt;p&gt;&amp;gt; db.foo.findOne(&lt;/p&gt;
{&apos;fields.5.3.0&apos;: 31}
&lt;p&gt;)._id&lt;br/&gt;
ObjectId(&quot;4c785f527b9830571f000002&quot;)&lt;br/&gt;
&amp;gt; db.foo.findOne(&lt;/p&gt;
{&apos;fields.5.3.3.1.0&apos;: 31}
&lt;p&gt;)._id&lt;br/&gt;
ObjectId(&quot;4c785f357b9830571f000000&quot;)&lt;br/&gt;
&amp;gt; db.foo.findOne(&lt;/p&gt;
{&apos;fields.5.2.3.1.0&apos;: 31}
&lt;p&gt;)._id&lt;br/&gt;
ObjectId(&quot;4c785f527b9830571f000002&quot;)&lt;/p&gt;

&lt;p&gt;I think the best solution is not to mix numeric keys and arrays due to the ambiguity that they introduce.&lt;/p&gt;</comment>
                            <comment id="17364" author="kosii" created="Wed, 25 Aug 2010 15:02:45 +0000"  >&lt;p&gt;In the javascript file I&apos;ve put 4 object in a collection (v, w, x, y). In order to get w and y objects, I respectively changed a field name from &apos;3&apos; to &apos;6&apos; in v and x object. I wrote two queries also (&lt;/p&gt;
{&apos;fields.5.3.0&apos;: 31}
&lt;p&gt; and &lt;/p&gt;
{&apos;fields.5.6.0&apos;: 31}
&lt;p&gt;), they are different only on the field name. The first query only matches one document &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/error.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;, but the second query matches two (w and y), although there is&apos;t any difference but only in the field name.&lt;/p&gt;</comment>
                            <comment id="17360" author="eliot" created="Wed, 25 Aug 2010 14:05:43 +0000"  >&lt;p&gt;I only see 1 document that should match the first query.&lt;/p&gt;

&lt;p&gt;If you think there is an error, please provide a .js file with the full example.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="10397" name="testcase.js" size="2222" author="kosii" created="Wed, 25 Aug 2010 15:02:45 +0000"/>
                    </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>Wed, 25 Aug 2010 14:05:43 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 25 weeks, 1 day 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>eliot</customfieldvalue>
            <customfieldvalue>kosii</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpgkn:</customfieldvalue>

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

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

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