<!-- 
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-391] Support both include and exclude on field filters</title>
                <link>https://jira.mongodb.org/browse/SERVER-391</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;find({}, &lt;/p&gt;
{a:1, b.c:0}
&lt;p&gt;)&lt;/p&gt;</description>
                <environment></environment>
        <key id="10808">SERVER-391</key>
            <summary>Support both include and exclude on field filters</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-optimization">Backlog - Query Optimization</assignee>
                                    <reporter username="mathias@mongodb.com">Mathias Stearn</reporter>
                        <labels>
                            <label>QFB</label>
                            <label>asya</label>
                    </labels>
                <created>Wed, 28 Oct 2009 12:57:08 +0000</created>
                <updated>Fri, 7 Apr 2023 13:13:34 +0000</updated>
                                                                            <component>Querying</component>
                                        <votes>16</votes>
                                    <watches>20</watches>
                                                                                                                <comments>
                            <comment id="1575679" author="david.storch" created="Fri, 19 May 2017 18:25:37 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=asya&quot; class=&quot;user-hover&quot; rel=&quot;asya&quot;&gt;asya&lt;/a&gt;, interesting observation that this can now be achieved in the aggregation framework with sequential projection stages. I&apos;d like to keep this open, however, since I think in the future we may want to design a more elegant way to express this kind of document transformation within a single aggregation stage.&lt;/p&gt;</comment>
                            <comment id="1571791" author="asya" created="Mon, 15 May 2017 23:13:27 +0000"  >&lt;p&gt;Do we really need this?  Assuming we merge projection and aggregation $project stage, I think there will be ways to get the thing described in the initial description?&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{$project:{a:1,b:1}},{$addFields:{&quot;b.c&quot;:&quot;$$REMOVE&quot;}}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;or&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{$project:{a:1,b:1}},{$project:{&quot;b.c&quot;:0}}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="809346" author="equequiel" created="Wed, 21 Jan 2015 09:59:19 +0000"  >&lt;p&gt;Hello, these are some tests that I have been doing concerning this issue:&lt;/p&gt;

&lt;p&gt;&amp;gt; db.test.findOne()&lt;br/&gt;
{&lt;br/&gt;
	&quot;_id&quot; : ObjectId(&quot;54b4fa2618c1e7c4365f43dc&quot;),&lt;br/&gt;
	&quot;family&quot; : &quot;Smith&quot;,&lt;br/&gt;
	&quot;children&quot; : [&lt;br/&gt;
		&lt;/p&gt;
{
			&quot;child_name&quot; : &quot;John&quot;
		}
&lt;p&gt;,&lt;/p&gt;
		{
			&quot;child_name&quot; : &quot;Anna&quot;
		}
&lt;p&gt;	]&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;And at the moment of executing the following queries:&lt;/p&gt;

&lt;p&gt;&amp;gt; db.test.find(&lt;/p&gt;
{&quot;family&quot; : &quot;Smith&quot;}
&lt;p&gt;,&lt;/p&gt;
{&quot;children&quot; : 1, &quot;family&quot; : 0,&quot;_id&quot;:0}
&lt;p&gt;)&lt;br/&gt;
error: {&lt;br/&gt;
	&quot;$err&quot; : &quot;You cannot currently mix including and excluding fields. Contact us if this is an issue.&quot;,&lt;br/&gt;
	&quot;code&quot; : 10053&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; db.test.find(&lt;/p&gt;
{&quot;family&quot; : &quot;Smith&quot;}
&lt;p&gt;,&lt;/p&gt;
{&quot;children&quot; : 0,  &quot;family&quot; : 1 ,&quot;_id&quot;:0}
&lt;p&gt;)&lt;br/&gt;
error: {&lt;br/&gt;
	&quot;$err&quot; : &quot;You cannot currently mix including and excluding fields. Contact us if this is an issue.&quot;,&lt;br/&gt;
	&quot;code&quot; : 10053&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; db.test.find(&lt;/p&gt;
{&quot;family&quot; : &quot;Smith&quot;}
&lt;p&gt;,&lt;/p&gt;
{&quot;children&quot; : 0,  &quot;family&quot; : 1 ,&quot;_id&quot;:1}
&lt;p&gt;)&lt;br/&gt;
error: {&lt;br/&gt;
	&quot;$err&quot; : &quot;You cannot currently mix including and excluding fields. Contact us if this is an issue.&quot;,&lt;br/&gt;
	&quot;code&quot; : 10053&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; db.test.find(&lt;/p&gt;
{&quot;family&quot; : &quot;Smith&quot;}
&lt;p&gt;,&lt;/p&gt;
{&quot;children&quot; : 0,  &quot;family&quot; : 0 ,&quot;_id&quot;:1}
&lt;p&gt;)&lt;br/&gt;
error: {&lt;br/&gt;
	&quot;$err&quot; : &quot;You cannot currently mix including and excluding fields. Contact us if this is an issue.&quot;,&lt;br/&gt;
	&quot;code&quot; : 10053&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;In this case for instance the result is fine:&lt;/p&gt;

&lt;p&gt;&amp;gt; db.test.find(&lt;/p&gt;
{&quot;family&quot; : &quot;Smith&quot;}
&lt;p&gt;,&lt;/p&gt;
{&quot;children&quot; : 1,  &quot;family&quot; : 1 ,&quot;_id&quot;:0}
&lt;p&gt;)&lt;br/&gt;
{ &quot;family&quot; : &quot;Smith&quot;, &quot;children&quot; : [  &lt;/p&gt;
{  &quot;child_name&quot; : &quot;John&quot; }
&lt;p&gt;,  &lt;/p&gt;
{  &quot;child_name&quot; : &quot;Anna&quot; }
&lt;p&gt; ] }&lt;/p&gt;</comment>
                            <comment id="480348" author="antonimmo" created="Fri, 10 Jan 2014 18:44:04 +0000"  >&lt;p&gt;Hi! I&apos;ve got this error.&lt;/p&gt;

&lt;p&gt;My case is the following:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;I&apos;ve made a mapReduce(map(),reduce(),options) and, by construction, each document in the options.out.reduce collection has a {_id, value} structure&lt;/li&gt;
	&lt;li&gt;The collection has a lot of documents, so it would be better if I can query directly from there instead of running an &quot;almost-never-ending&quot; find+forEach to create a new structure from it&lt;/li&gt;
	&lt;li&gt;There&apos;s some documents in that collection (about 5%, but it&apos;s still a large amount of data and MB to transfer along the network/internet) which need some update&lt;/li&gt;
	&lt;li&gt;My query if more or less (for security reasons I modified the field names) like this:&lt;br/&gt;
db.find({&quot;value.Coupons&quot;:{$size:0}},
{&quot;_id.field1&quot;:1, &quot;_id.field2&quot;:1, &quot;_id.field3&quot;:0, &quot;_id.field4&quot;:0}
&lt;p&gt;)&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;As I&apos;ve already said, I only need 2 of the 4 fields of the key subdocument because of network traffic (and time, obviously) reasons, and this is an issue for us because it spends twice the time we would like it to. This is the main goal of the projection operator, isn&apos;t it?&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="456774" author="mitar" created="Fri, 15 Nov 2013 12:03:04 +0000"  >&lt;p&gt;My use case is:&lt;/p&gt;

&lt;p&gt;Publications.find(&lt;/p&gt;
{&apos;importing.person._id&apos;: personId}
&lt;p&gt;, &lt;/p&gt;
{&apos;importing.$&apos;: 1, &apos;importing.$.temporaryFile&apos;: 0}
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;So I would like to get only that subdocument of importing belonging to the person, but remove temporaryFile field in those subdocument.&lt;/p&gt;</comment>
                            <comment id="19300" author="zippy1981" created="Mon, 18 Oct 2010 18:45:27 +0000"  >&lt;p&gt;The message this currently generates is: &lt;/p&gt;

&lt;p&gt;db.events.findOne(null, {_id:1, Name:1, &quot;Locations&quot;:1, &quot;Locations.v.Dates&quot;: 0}) &lt;/p&gt;

&lt;p&gt;Mon Oct 18 12:23:27 uncaught exception: error { &lt;br/&gt;
        &quot;$err&quot; : &quot;You cannot currently mix including and excluding fields. Contact us if this is an issue.&quot;, &lt;br/&gt;
        &quot;code&quot; : 10053 &lt;br/&gt;
} &lt;/p&gt;</comment>
                            <comment id="19299" author="zippy1981" created="Mon, 18 Oct 2010 18:44:34 +0000"  >&lt;p&gt;See &lt;a href=&quot;http://groups.google.com/group/mongodb-user/browse_thread/thread/c53d99916e46ae1a/d4a79a34104377f9#d4a79a34104377f9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://groups.google.com/group/mongodb-user/browse_thread/thread/c53d99916e46ae1a/d4a79a34104377f9#d4a79a34104377f9&lt;/a&gt; for commentary.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="996906">SERVER-44558</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>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25126"><![CDATA[Query Optimization]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 18 Oct 2010 18:44:34 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 38 weeks, 5 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_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>antonimmo</customfieldvalue>
            <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-query-optimization</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>equequiel</customfieldvalue>
            <customfieldvalue>zippy1981</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
            <customfieldvalue>mitar</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpv0f:</customfieldvalue>

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

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

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