<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:53:10 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-149] $exists operator</title>
                <link>https://jira.mongodb.org/browse/SERVER-149</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Please add an operator named &quot;$exists&quot; which checks if a certain path exists in a document. &lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Syntax: &lt;/p&gt;
{ &apos;a.b.c.$exists&apos; 1 }
&lt;p&gt; &lt;/p&gt;

&lt;p&gt;=&amp;gt; returns all documents which have a nested document &quot;b&quot;  with a key &quot;c&quot; &lt;/p&gt;
</description>
                <environment></environment>
        <key id="10288">SERVER-149</key>
            <summary>$exists operator</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="x6j8x">Sascha Matzke</reporter>
                        <labels>
                    </labels>
                <created>Sun, 12 Jul 2009 05:01:55 +0000</created>
                <updated>Tue, 12 Jul 2016 00:30:26 +0000</updated>
                            <resolved>Wed, 12 Aug 2009 23:35:41 +0000</resolved>
                                                    <fixVersion>0.9.8</fixVersion>
                                    <component>Usability</component>
                                        <votes>1</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="10442" author="eliot" created="Sat, 15 Aug 2009 10:10:02 +0000"  >&lt;p&gt;Released in 0.9.8&lt;/p&gt;</comment>
                            <comment id="10414" author="aaron" created="Wed, 12 Aug 2009 17:47:56 +0000"  >&lt;p&gt;Implemented and tested in exists.js&lt;/p&gt;

&lt;p&gt;The following syntax seemed the most logical and consistent with other query operators:&lt;br/&gt;
db.c.find( {a:{$exists:true}} );&lt;br/&gt;
db.c.find( {a:{$exists:false}} );&lt;/p&gt;</comment>
                            <comment id="10408" author="aaron" created="Wed, 12 Aug 2009 00:41:40 +0000"  >&lt;p&gt;Ok cool, will do&lt;/p&gt;</comment>
                            <comment id="10407" author="eliot" created="Tue, 11 Aug 2009 16:52:47 +0000"  >&lt;p&gt;Right - this operator is specifically needed because there are cases where we don&apos;t want null and missing values to be treated the same.&lt;/p&gt;</comment>
                            <comment id="10406" author="aaron" created="Tue, 11 Aug 2009 15:27:24 +0000"  >&lt;p&gt;My impression was that in the matcher we generally treated null values and missing values equivalently.  For example, in the above, if you try to find &lt;/p&gt;
{a:null}
&lt;p&gt; using your example, both {} and &lt;/p&gt;
{a:null}
&lt;p&gt; are returned.  This is why I made sure that {a:{$ne:null}} would only match &lt;/p&gt;
{a:1}
&lt;p&gt; of the three documents (rather than the first and last as described above).&lt;/p&gt;

&lt;p&gt;Since we treat null and missing the same in basic finds, just want to double check that we want to differentiate between the two in a new $exists operator.&lt;/p&gt;</comment>
                            <comment id="10395" author="eliot" created="Tue, 11 Aug 2009 03:56:44 +0000"  >
&lt;p&gt;$exists should be ok if its null&lt;br/&gt;
so if you have&lt;br/&gt;
{}&lt;/p&gt;
{ a : null }
{ a : 1 }

&lt;p&gt;if i say $exists a, then it should return the last 2, not the first and last&lt;/p&gt;</comment>
                            <comment id="10393" author="aaron" created="Tue, 11 Aug 2009 02:06:32 +0000"  >&lt;p&gt;I think you can get the desired behavior with $ne: null.  For example:&lt;br/&gt;
t.find( {&apos;a.b&apos;:{$ne:null}} )&lt;/p&gt;

&lt;p&gt;I just fixed a bug in that prevented this from working correctly in some cases, but latest git source should work correctly.  Please reopen the bug if you have any trouble.&lt;/p&gt;</comment>
                            <comment id="10277" author="namlook" created="Wed, 15 Jul 2009 11:06:48 +0000"  >&lt;p&gt;I think $exists operator is a good idea but I disagree with the syntax.&lt;/p&gt;

&lt;p&gt;I think somethink like this is more consistant with other operators :&lt;/p&gt;

&lt;p&gt;{&quot;$exists&quot;:{&quot;foo.bar&quot;:1, &quot;foo.spam&quot;:0}}&lt;/p&gt;

&lt;p&gt;wich mean, all documents where foo.bar exists and where foo.spam is not present in the document.&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>8.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 15 Jul 2009 11:06:48 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            14 years, 27 weeks, 4 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>aaron</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>namlook</customfieldvalue>
            <customfieldvalue>x6j8x</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpxj3:</customfieldvalue>

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

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

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