<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:55:16 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-825] $pullAll API is not consistent with $pull API</title>
                <link>https://jira.mongodb.org/browse/SERVER-825</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I&apos;m trying to pull multiple hashes from an array but only know the value of one of the hash keys. I expected $pullAll to work in a similar manner to $pull but got an error message instead.&lt;/p&gt;

&lt;p&gt;use temp&lt;br/&gt;
db.dropDatabase()&lt;/p&gt;

&lt;p&gt;db.bands.save({&lt;br/&gt;
  name: &apos;The Beatles&apos;,&lt;br/&gt;
  members: [&lt;br/&gt;
    &lt;/p&gt;
{name: &apos;John&apos;,   instrument: &apos;guitar&apos;}
&lt;p&gt;,&lt;br/&gt;
    &lt;/p&gt;
{name: &apos;Paul&apos;,   instrument: &apos;bass&apos;}
&lt;p&gt;,&lt;br/&gt;
    &lt;/p&gt;
{name: &apos;George&apos;, instrument: &apos;guitar&apos;}
&lt;p&gt;,&lt;/p&gt;
    {name: &apos;Ringo&apos;,  instrument: &apos;drums&apos;}
&lt;p&gt;  ]&lt;br/&gt;
})&lt;/p&gt;

&lt;p&gt;db.bands.update({}, {$pull: {members: &lt;/p&gt;
{instrument: &apos;drums&apos;}
&lt;p&gt;}})&lt;br/&gt;
// Ringo is removed&lt;/p&gt;

&lt;p&gt;db.bands.update({}, {$pullAll: {members: &lt;/p&gt;
{instrument: [&apos;guitar&apos;, &apos;bass&apos;]}
&lt;p&gt;}})&lt;br/&gt;
// John, Paul, and George should be removed but get this error instead:&lt;br/&gt;
// Modifier $pushAll/pullAll allowed for arrays only&lt;/p&gt;

&lt;p&gt;db.bands.update({}, {&lt;br/&gt;
  $pullAll: {members: [&lt;br/&gt;
    &lt;/p&gt;
{name: &apos;John&apos;,   instrument: &apos;guitar&apos;}
&lt;p&gt;,&lt;br/&gt;
    &lt;/p&gt;
{name: &apos;Paul&apos;,   instrument: &apos;bass&apos;}
&lt;p&gt;,&lt;/p&gt;
    {name: &apos;George&apos;, instrument: &apos;guitar&apos;}
&lt;p&gt;  ]}&lt;br/&gt;
})&lt;br/&gt;
// It works if you specify the EXACT hash&lt;/p&gt;

&lt;p&gt;db.bands.find()&lt;/p&gt;</description>
                <environment></environment>
        <key id="11612">SERVER-825</key>
            <summary>$pullAll API is not consistent with $pull API</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="eliot">Eliot Horowitz</assignee>
                                    <reporter username="msheakoski">Michael Sheakoski</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Mar 2010 14:38:29 +0000</created>
                <updated>Fri, 10 Jun 2011 00:59:41 +0000</updated>
                            <resolved>Thu, 8 Apr 2010 00:09:32 +0000</resolved>
                                    <version>1.4.0</version>
                                                    <component>Usability</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="36952" author="nakamura" created="Fri, 10 Jun 2011 00:59:41 +0000"  >&lt;p&gt;I also ran into this--it is confusing that pullAll has different behavior than pull.  There should at least be a note in the API that pullAll only supports exact matches.&lt;/p&gt;</comment>
                            <comment id="14224" author="eliot" created="Thu, 13 May 2010 06:22:51 +0000"  >&lt;p&gt;Please see above comment.&lt;br/&gt;
I don&apos;t think this case makes sense so is resolved as &quot;Works as Designed&quot;&lt;br/&gt;
If there is a case where you can&apos;t use the example solution, please post the details.&lt;/p&gt;</comment>
                            <comment id="14222" author="wangdebing" created="Thu, 13 May 2010 03:37:21 +0000"  >&lt;p&gt;please re-open I also encountered this problem v 1.4.1&lt;/p&gt;</comment>
                            <comment id="13501" author="eliot" created="Thu, 8 Apr 2010 00:09:32 +0000"  >&lt;p&gt;see for an example&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/blob/master/jstests/pullall2.js&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/blob/master/jstests/pullall2.js&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;please re-open if there is something i missed&lt;/p&gt;</comment>
                            <comment id="13500" author="eliot" created="Thu, 8 Apr 2010 00:07:47 +0000"  >&lt;p&gt;on futher though, i&apos;m not sure this makes sense.&lt;/p&gt;

&lt;p&gt;$pullAll seems to make more sense to me as exact matches&lt;/p&gt;

&lt;p&gt;instead of&lt;br/&gt;
db.bands.update({}, &lt;br/&gt;
{ &lt;br/&gt;
  $pullAll: {members: [ &lt;br/&gt;
    &lt;/p&gt;
{instrument: &apos;guitar&apos;}
&lt;p&gt;, &lt;/p&gt;
    {instrument: &apos;bass&apos;} 
&lt;p&gt;  ] &lt;br/&gt;
}}) &lt;/p&gt;

&lt;p&gt;you should be able to do&lt;br/&gt;
db.bands.update({}, &lt;br/&gt;
{ &lt;br/&gt;
  $pull: {members: { instrument : &lt;/p&gt;
{ $in : [ &quot;guitar&quot; , &quot;bass&quot; ] }
&lt;p&gt; } }&lt;br/&gt;
}&lt;/p&gt;</comment>
                            <comment id="13176" author="msheakoski" created="Wed, 24 Mar 2010 17:19:52 +0000"  >&lt;p&gt;After speaking with Michael Dirolf, this is the API he suggested:&lt;/p&gt;

&lt;p&gt;db.bands.update({},&lt;br/&gt;
{&lt;br/&gt;
  $pullAll: {members: [&lt;br/&gt;
    &lt;/p&gt;
{instrument: &apos;guitar&apos;}
&lt;p&gt;,&lt;/p&gt;
    {instrument: &apos;bass&apos;}
&lt;p&gt;  ]&lt;br/&gt;
}})&lt;/p&gt;

&lt;p&gt;This would make it consistent with $pull once it is implemented.&lt;/p&gt;</comment>
                            <comment id="13175" author="mike" created="Wed, 24 Mar 2010 17:07:52 +0000"  >&lt;p&gt;oops - closed prematurely. didn&apos;t realize the behavior for $pull had changed. still i think the array in the example will need to be moved up one level.&lt;/p&gt;</comment>
                            <comment id="13174" author="mike" created="Wed, 24 Mar 2010 16:58:46 +0000"  >&lt;p&gt;$pullAll takes an array, not a document - it pulls all items in the array.&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, 24 Mar 2010 16:58:46 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 36 weeks, 6 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>
                            12 years, 36 weeks, 6 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>eliot</customfieldvalue>
            <customfieldvalue>mike</customfieldvalue>
            <customfieldvalue>msheakoski</customfieldvalue>
            <customfieldvalue>nakamura</customfieldvalue>
            <customfieldvalue>wangdebing</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrppvj:</customfieldvalue>

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

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

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