<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:17: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-8585] null and {$exists: false} queries inside arrays match less than I&apos;d expect</title>
                <link>https://jira.mongodb.org/browse/SERVER-8585</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If I understand properly, the general rule for doing a query &lt;/p&gt;
{&apos;a.x&apos;: QUERY}
&lt;p&gt; where &apos;a&apos; is an array is that it should match if there is any element of the &apos;a&apos; array where &lt;/p&gt;
{x: QUERY}
&lt;p&gt; matches.&lt;/p&gt;

&lt;p&gt;But Mongo 2.2.1 does this:&lt;/p&gt;

&lt;p&gt;&amp;gt; db.x.remove({}); db.x.insert({a: [&lt;/p&gt;
{x: 1}
&lt;p&gt;, {}]})&lt;br/&gt;
&amp;gt; db.x.findOne({&apos;a.x&apos;: {$exists: false}})&lt;br/&gt;
null&lt;br/&gt;
&amp;gt; db.x.findOne(&lt;/p&gt;
{&apos;a.x&apos;: null}
&lt;p&gt;)&lt;br/&gt;
null&lt;/p&gt;

&lt;p&gt;That surprises me: I&apos;d expect both of these to match, because there is an element of the &apos;a&apos; array (the {}) such that both {x: {$exists: false}} and &lt;/p&gt;
{x: null}
&lt;p&gt; matches.&lt;/p&gt;

&lt;p&gt;I don&apos;t see any relevant tests in the jstests directory asserting that the current behavior is expected. Is this behavior intentional or a bug?&lt;/p&gt;</description>
                <environment>Tested with 2.2.1 on MacOS X.</environment>
        <key id="65360">SERVER-8585</key>
            <summary>null and {$exists: false} queries inside arrays match less than I&apos;d expect</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="aaron">Aaron Staple</assignee>
                                    <reporter username="glasser">David Glasser</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Feb 2013 22:50:47 +0000</created>
                <updated>Tue, 21 May 2013 02:05:09 +0000</updated>
                            <resolved>Thu, 28 Feb 2013 00:12:19 +0000</resolved>
                                    <version>2.2.1</version>
                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="340254" author="glasser" created="Tue, 21 May 2013 02:05:09 +0000"  >&lt;p&gt;My reading of the changes made for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6400&quot; title=&quot;Refactor Matcher/QueryExpression&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6400&quot;&gt;&lt;del&gt;SERVER-6400&lt;/del&gt;&lt;/a&gt; is that `&lt;/p&gt;
{&apos;a.x&apos;: null}
&lt;p&gt;` now does what I expect (and the arrayfind5.js test has been changed), but `{&apos;a.x&apos;: {$exists: false}}` does not.&lt;/p&gt;</comment>
                            <comment id="277624" author="aaron" created="Thu, 28 Feb 2013 00:12:01 +0000"  >&lt;p&gt;David - I&apos;m going to close this ticket, but feel free to reopen if you have further questions.&lt;/p&gt;</comment>
                            <comment id="269382" author="aaron" created="Mon, 18 Feb 2013 18:21:17 +0000"  >&lt;p&gt;It looks like one place this is tested is jstests/arrayfind5.js&lt;/p&gt;</comment>
                            <comment id="269380" author="aaron" created="Mon, 18 Feb 2013 18:19:05 +0000"  >&lt;p&gt;I believe this is &quot;works as designed&quot; per &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3377&quot; title=&quot;$elemMatch results not a subset of non $elemMatch results when there are missing values&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3377&quot;&gt;&lt;del&gt;SERVER-3377&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There is some more discussion in the description of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-5065&quot; title=&quot;a missing field nested within an array is sorted as &amp;#39;null&amp;#39;, even if the same field exists inside another array element&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-5065&quot;&gt;&lt;del&gt;SERVER-5065&lt;/del&gt;&lt;/a&gt; in the section on &quot;Query Matching Semantics&quot;.&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>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 18 Feb 2013 18:19:05 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            10 years, 39 weeks, 2 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>aaron</customfieldvalue>
            <customfieldvalue>glasser</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrn6a7:</customfieldvalue>

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

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

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