<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:53:56 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-393] $exists queries should use index</title>
                <link>https://jira.mongodb.org/browse/SERVER-393</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description></description>
                <environment></environment>
        <key id="10811">SERVER-393</key>
            <summary>$exists queries should use index</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="aaron">Aaron Staple</assignee>
                                    <reporter username="mathias@mongodb.com">Mathias Stearn</reporter>
                        <labels>
                    </labels>
                <created>Wed, 28 Oct 2009 16:19:59 +0000</created>
                <updated>Tue, 12 Jul 2016 00:27:10 +0000</updated>
                            <resolved>Wed, 6 Apr 2011 01:26:39 +0000</resolved>
                                                    <fixVersion>1.9.0</fixVersion>
                                    <component>Querying</component>
                                        <votes>19</votes>
                                    <watches>17</watches>
                                                                                                                <comments>
                            <comment id="27863" author="auto" created="Tue, 5 Apr 2011 20:14:44 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;astaple&apos;, u&apos;name&apos;: u&apos;Aaron&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-393&quot; title=&quot;$exists queries should use index&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-393&quot;&gt;&lt;del&gt;SERVER-393&lt;/del&gt;&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2902&quot; title=&quot;Index keys are not generated for numerically referenced array elements&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2902&quot;&gt;&lt;del&gt;SERVER-2902&lt;/del&gt;&lt;/a&gt; additional tests&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/4c981f252999738777e9c6bf1743aea22941861c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/4c981f252999738777e9c6bf1743aea22941861c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="27856" author="auto" created="Tue, 5 Apr 2011 20:14:38 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;astaple&apos;, u&apos;name&apos;: u&apos;Aaron&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-393&quot; title=&quot;$exists queries should use index&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-393&quot;&gt;&lt;del&gt;SERVER-393&lt;/del&gt;&lt;/a&gt; Use index bounds for exists:false&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/a7360cc67fffc5951f1f5e898f90e2fc3575e396&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/a7360cc67fffc5951f1f5e898f90e2fc3575e396&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="27855" author="auto" created="Tue, 5 Apr 2011 20:14:37 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;astaple&apos;, u&apos;name&apos;: u&apos;Aaron&apos;, u&apos;email&apos;: u&apos;aaron@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-393&quot; title=&quot;$exists queries should use index&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-393&quot;&gt;&lt;del&gt;SERVER-393&lt;/del&gt;&lt;/a&gt; Allow rejecting document using non exists indexed fields when an exists constraint is present&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/f97863227992f5e25ebe0882875d54cc5cc5937a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/f97863227992f5e25ebe0882875d54cc5cc5937a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="14568" author="scotthernandez" created="Thu, 3 Jun 2010 12:46:36 +0000"  >&lt;p&gt;(If you, like me, are searching for the issue about why $exists fails in the cases below, this is the issue to watch. Taken from a duplicate issue.)&lt;/p&gt;

&lt;p&gt;&amp;gt; db.people.save(&lt;/p&gt;
{ fname: &quot;BOB&quot;, lname: &quot;SMITH&quot; }
&lt;p&gt;) &lt;br/&gt;
&amp;gt; db.people.find(&lt;/p&gt;
{ lname: &quot;SMITH&quot; }
&lt;p&gt;) &lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;4c06e2eb4138a24d33ee0fdc&quot;), &quot;fname&quot; : &quot;BOB&quot;, &quot;lname&quot; : &quot;SMITH&quot; } 
&lt;p&gt;&amp;gt; db.people.save(&lt;/p&gt;
{ fname: &quot;BOB&quot;, lname: &quot;SMITH&quot;, mname: &quot;ROBERT&quot;, suffix: &quot;JR&quot; }
&lt;p&gt;) &lt;br/&gt;
&amp;gt; db.people.ensureIndex(&lt;/p&gt;
{&quot;lname&quot;:1,&quot;fname&quot;:1,&quot;mname&quot;:1,&quot;suffix&quot;:1}
&lt;p&gt;); &lt;br/&gt;
&amp;gt; db.people.find({ lname: &quot;SMITH&quot;, mname: &lt;/p&gt;
{ $exists: false }
&lt;p&gt; }) &lt;/p&gt;

&lt;p&gt;-&lt;del&gt;Nothing Returned&lt;/del&gt;- &lt;/p&gt;

&lt;p&gt;It sure seems like it is using the index and not finding the correct doc (as shown below).&lt;/p&gt;

&lt;p&gt;Also, using null for the missing field value returns the doc even thought that is incorrect (since the index stores a null for that index value). &lt;/p&gt;

&lt;p&gt;&amp;gt; db.people.find(&lt;/p&gt;
{ lname: &quot;SMITH&quot;, mname: null }
&lt;p&gt;) &lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;4c06e2eb4138a24d33ee0fdc&quot;), &quot;fname&quot; : &quot;BOB&quot;, &quot;lname&quot; : &quot;SMITH&quot; } </comment>
                            <comment id="11289" author="redbeard0531" created="Mon, 7 Dec 2009 16:10:46 +0000"  >&lt;p&gt;Need to meet to discuss desired sort order.&lt;/p&gt;</comment>
                            <comment id="11175" author="dwight_10gen" created="Wed, 18 Nov 2009 15:56:03 +0000"  >&lt;p&gt;also: &lt;/p&gt;

&lt;p&gt;&amp;gt; db.order.find().sort(&lt;/p&gt;
{x:1}
&lt;p&gt;)&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;4b045b0beda5232d46e5db6b&quot;) }
&lt;p&gt;{ &quot;_id&quot; : ObjectId(&quot;4b045b40eda5232d46e5db6e&quot;), &quot;x&quot; : &lt;/p&gt;
{ $minKey : 1 }
&lt;p&gt; }&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;4b045b15eda5232d46e5db6c&quot;), &quot;x&quot; : null }
{ &quot;_id&quot; : ObjectId(&quot;4b045b1beda5232d46e5db6d&quot;), &quot;x&quot; : 1 }
&lt;p&gt;{ &quot;_id&quot; : ObjectId(&quot;4b045b42eda5232d46e5db6f&quot;), &quot;x&quot; : &lt;/p&gt;
{ $maxKey : 1 }
&lt;p&gt; }&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; db.order.ensureIndex(&lt;/p&gt;
{x:1}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; db.order.find().sort(&lt;/p&gt;
{x:1}
&lt;p&gt;)&lt;br/&gt;
{ &quot;_id&quot; : ObjectId(&quot;4b045b40eda5232d46e5db6e&quot;), &quot;x&quot; : &lt;/p&gt;
{ $minKey : 1 }
&lt;p&gt; }&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;4b045b0beda5232d46e5db6b&quot;) }
{ &quot;_id&quot; : ObjectId(&quot;4b045b15eda5232d46e5db6c&quot;), &quot;x&quot; : null }
{ &quot;_id&quot; : ObjectId(&quot;4b045b1beda5232d46e5db6d&quot;), &quot;x&quot; : 1 }
&lt;p&gt;{ &quot;_id&quot; : ObjectId(&quot;4b045b42eda5232d46e5db6f&quot;), &quot;x&quot; : &lt;/p&gt;
{ $maxKey : 1 }
&lt;p&gt; }&lt;/p&gt;

&lt;p&gt;in the above, i think the order is right for the indexed case, which means this part of the problem can be fixed without an index change.&lt;/p&gt;</comment>
                            <comment id="11001" author="redbeard0531" created="Wed, 28 Oct 2009 16:56:03 +0000"  >&lt;p&gt;Pushing to 1.3.0 because fixing this will require adjusting sort order for null.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="15485">SERVER-2905</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="10892">SERVER-429</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 18 Nov 2009 15:56:03 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 46 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_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>aaron</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>dwight@mongodb.com</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpv07:</customfieldvalue>

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

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

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