<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:55:48 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-1014] A modifier to delete a single value from an array</title>
                <link>https://jira.mongodb.org/browse/SERVER-1014</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When dealing with arrays with non unique values, it is impossible to remove a single value from that array in 1 update.&lt;/p&gt;

&lt;p&gt;$pop doesn&apos;t work, because the value can be anywhere in the array.&lt;br/&gt;
$pull doesn&apos;t work, because that will remove all occurences of the value (which can happen in a non unique array)&lt;br/&gt;
$unset doesn&apos;t work, because that sets the value to NULL, instead of removing it.&lt;/p&gt;

&lt;p&gt;EG:&lt;/p&gt;

&lt;p&gt;&amp;gt; db.example.remove() &lt;br/&gt;
&amp;gt; db.example.insert({_id:1, sequence : &lt;span class=&quot;error&quot;&gt;&amp;#91;1,2,3,4,3,2,3,4&amp;#93;&lt;/span&gt;}) &lt;br/&gt;
&amp;gt; db.example.update({_id:1}, { $unset : { &apos;sequence.1&apos; : 1 }}) &lt;br/&gt;
&amp;gt; db.example.find() &lt;/p&gt;

{ &quot;_id&quot; : 1, &quot;sequence&quot; : [ 1, null, 3, 4, 3, 2, 3, 4 ] } 

&lt;p&gt;I&apos;m looking for a modifier that leaves me with&lt;/p&gt;

{ &quot;_id&quot; : 1, &quot;sequence&quot; : [ 1, 3, 4, 3, 2, 3, 4 ] } 

&lt;p&gt;Maybe something like&lt;/p&gt;

&lt;p&gt;&amp;gt; db.example.update({_id:1}, { $remove : { &apos;sequence.1&apos; : 1 }}) &lt;/p&gt;

&lt;p&gt;I&apos;m curious what you think of it. Currently, with $addToSet and $pull it&apos;s very easy to manage arrays with unique values. For non unique arrays, there&apos;s $push to add values, but no proper way to remove values.&lt;/p&gt;</description>
                <environment></environment>
        <key id="11775">SERVER-1014</key>
            <summary>A modifier to delete a single value from an array</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="backlog-server-query">Backlog - Query Team</assignee>
                                    <reporter username="wouter">Wouter</reporter>
                        <labels>
                            <label>pull-request</label>
                            <label>storch</label>
                            <label>syntax</label>
                    </labels>
                <created>Tue, 13 Apr 2010 16:39:20 +0000</created>
                <updated>Thu, 6 Apr 2023 16:24:30 +0000</updated>
                            <resolved>Sat, 29 Jun 2019 08:52:09 +0000</resolved>
                                                                    <component>Write Ops</component>
                                        <votes>119</votes>
                                    <watches>83</watches>
                                                                                                                <comments>
                            <comment id="2879806" author="cherviakov.ivan@gmail.com" created="Sat, 15 Feb 2020 02:51:27 +0000"  >&lt;p&gt;Well, would be there example how to use microscope to bash nails there it is. But since it is really working, is it possible to add some alias operator, which under the hood runs this monstrosity? As essentially we only need to pass name of array field and index. Maybe something like&lt;br/&gt;
db.example.update({}, { $removeArrayElByIndex: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;sequence&amp;#39;, index&amp;#93;&lt;/span&gt; });&lt;/p&gt;</comment>
                            <comment id="2305681" author="asya" created="Sat, 29 Jun 2019 08:52:09 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40381&quot; title=&quot;Add the ability to specify a pipeline to an update command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40381&quot;&gt;&lt;del&gt;SERVER-40381&lt;/del&gt;&lt;/a&gt; implemented support for aggregation expressions to specify update for 4.2.&#160;&lt;/p&gt;

&lt;p&gt;&#160;You can see some examples &lt;a href=&quot;https://docs.mongodb.com/master/reference/command/update/index.html#update-command-example-agg&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This can be handled a couple of different ways in aggregation.&#160; One way would be to determine position of the array element that you want to remove and use $slice and $concatArrays.&#160; &#160;Note that if the position is already known then it&apos;s a simpler version of the same thing.&lt;/p&gt;

&lt;p&gt;Position known (P)&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;db.example.update({}, [&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;     {$set:{ sequence: {&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;                   $concatArrays:[ &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;                       {$slice:[ &quot;$sequence&quot;, P ]}, &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;                       {$slice:[ &quot;$sequence&quot;, {$add:[1,P]}, {$size:&quot;$sequence&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;                    ]&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;     }}}&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;]);&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; &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Position not known (first occurrence that matches a condition:&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;db.example.update({}, [&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;     {$set:{ sequence: {&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;         $let:{ vars: {p: {$indexOfArray:[&quot;$sequence&quot;, 2] } },&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;                    in:{$concatArrays:[ &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;                       {$slice:[ &quot;$sequence&quot;, &quot;$$p&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;                       {$slice:[ &quot;$sequence&quot;, {$add:[1,&quot;$$p&quot;]}, {$size:&quot;$sequence&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;                    ]&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;     }}}&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;]);&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; &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;I&apos;ve simplified slightly you would need to check that p is not -1 to avoid getting the wrong result (when there is no match).&lt;/p&gt;</comment>
                            <comment id="2277060" author="ethanfar" created="Sun, 9 Jun 2019 11:49:35 +0000"  >&lt;p&gt;Hi,&#160;is there any update on this issue ? It&apos;s been 9 years since it was opened, and almost 6 months since the last update. The workarounds you mention are not only less efficient, but guaranteeing their correctness is cumbersome and leads to a lot of code no one can later figure out.&#160;&lt;/p&gt;

&lt;p&gt;This seems really intuitive and I would think that 9 years were quite enough to make a decision regarding syntax. As you can see by the comments, this is a burning issue for a lot of people. Could you please consider raising its priority ?&lt;/p&gt;

&lt;p&gt;Thanks in advance,&lt;/p&gt;

&lt;p&gt;Ethan&lt;/p&gt;</comment>
                            <comment id="2105709" author="asya" created="Fri, 4 Jan 2019 17:02:51 +0000"  >&lt;p&gt;Note that there are a couple of (less efficient) workarounds for this in current versions.  They involve more than one operation but correctness can be guaranteed, just not as efficient as a single update.&lt;/p&gt;</comment>
                            <comment id="2105629" author="asya" created="Fri, 4 Jan 2019 16:19:53 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=nachiketg&quot; class=&quot;user-hover&quot; rel=&quot;nachiketg&quot;&gt;nachiketg&lt;/a&gt; see my comment above - we are still working on possible solution to make this possible for the next major release.  &lt;/p&gt;</comment>
                            <comment id="2104561" author="nachiketg" created="Thu, 3 Jan 2019 18:26:53 +0000"  >&lt;p&gt;Can we please get a timeline for this? It will be very much appreciated!&lt;/p&gt;</comment>
                            <comment id="2037154" author="desfenfe" created="Mon, 22 Oct 2018 09:22:06 +0000"  >&lt;p&gt;This messes up any effort to work with embedded documents, you should guarantee if you care about your product.&lt;/p&gt;</comment>
                            <comment id="2027416" author="asya" created="Tue, 9 Oct 2018 07:58:46 +0000"  >&lt;p&gt;We are considering possible syntax to alleviate this issue for the next major release.   No guarantees, of course, but we are working on it.&lt;/p&gt;</comment>
                            <comment id="2005377" author="nachiketg" created="Mon, 17 Sep 2018 18:42:46 +0000"  >&lt;p&gt;It is highly desirable to have this implemented ($remove) which is indicative from the comments above as well.&lt;/p&gt;

&lt;p&gt;Can we know if this is in the plan to be implemented? If yes, I am interested in knowing if we have a timeline.&lt;/p&gt;</comment>
                            <comment id="1935687" author="cf@truemarketllc.com" created="Sun, 1 Jul 2018 14:40:56 +0000"  >&lt;p&gt;Since $unset almost works (leaves a null in the array element), how about something like:&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;   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; { $unset: { &quot;sequence.3&quot;: { $remove: 1 } } }&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="1713398" author="rcardin" created="Tue, 31 Oct 2017 13:43:39 +0000"  >&lt;p&gt;Until a native solution will be implemented in Mongo, you can evaluate a workaround that I developed: &lt;a href=&quot;https://stackoverflow.com/a/47036857/1173755&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://stackoverflow.com/a/47036857/1173755&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1670395" author="sambugj" created="Tue, 12 Sep 2017 14:50:58 +0000"  >&lt;p&gt;$pop with $position is needed!&lt;/p&gt;</comment>
                            <comment id="1614059" author="pudility" created="Wed, 5 Jul 2017 14:22:14 +0000"  >&lt;p&gt;Is there any way to post this on something like Bountysource? Because I would be willing to pay money to have this fixed.&lt;/p&gt;</comment>
                            <comment id="1447658" author="bgsosh@gmail.com" created="Fri, 2 Dec 2016 13:36:13 +0000"  >&lt;p&gt;Very frustrating that after more than SIX YEARS this has still not been addressed.  There is no way to atomically remove data from an array at a particular position.  How is this considered minor?&lt;/p&gt;</comment>
                            <comment id="1368620" author="ylmbtm" created="Fri, 26 Aug 2016 03:59:45 +0000"  >&lt;p&gt;guys please, we need this very much, this issue won&apos;t take you more than three minutes.&lt;/p&gt;

&lt;p&gt;need this.&lt;/p&gt;</comment>
                            <comment id="1366877" author="4f2e4a2e" created="Wed, 24 Aug 2016 18:17:52 +0000"  >&lt;p&gt;Just got informed on this issues, which goes back to 2010!? by reading &quot;Meteor in Action&quot;.&lt;br/&gt;
I hope it gets fixed soon. Meteor ftwwWWWwwwwwWWWWWwwwww!&lt;/p&gt;</comment>
                            <comment id="1223805" author="jpp" created="Mon, 4 Apr 2016 07:55:42 +0000"  >&lt;p&gt;I&apos;d vote for $pop with $position, too, would make a lot of sense. It would also give drivers a greater flexibility to provide higher-level functions&#8212;e.g. given two arrays of objects, generate an update description which would convert one into the other.&lt;/p&gt;</comment>
                            <comment id="1218579" author="isole" created="Tue, 29 Mar 2016 18:21:43 +0000"  >&lt;p&gt;It&apos;s been almost 6 years. C&apos;mon devs, we need this&lt;/p&gt;</comment>
                            <comment id="1024975" author="derelinguo" created="Wed, 9 Sep 2015 11:00:31 +0000"  >&lt;p&gt;Woah! I thought that comment was aimed at me. Had totally forgotten about the &apos;shut the fuck up carl!&apos; thing. &lt;/p&gt;

&lt;p&gt;Fair point though.&lt;/p&gt;</comment>
                            <comment id="933644" author="fusername" created="Mon, 8 Jun 2015 03:49:59 +0000"  >&lt;p&gt;$pop with $position is good. could someone please implement it?&lt;/p&gt;</comment>
                            <comment id="892126" author="rannooo" created="Sat, 18 Apr 2015 13:33:50 +0000"  >&lt;p&gt;Would really like to see this implemented in a near release.&lt;/p&gt;</comment>
                            <comment id="709601" author="jb_sulli" created="Tue, 2 Sep 2014 20:09:11 +0000"  >&lt;p&gt;I really want a $pullOne operator. Just pass it an object to match, like $pull, but it will only remove one match and stop. Simple, elegant, and does what I need without tracking indexes which isn&apos;t going to be autonomous. &lt;/p&gt;</comment>
                            <comment id="656744" author="meruem" created="Sat, 12 Jul 2014 07:30:56 +0000"  >&lt;p&gt;I just don&apos;t understand how this feature is not implemented. Ex: It is not necessary (or recommended) to use &quot;Id&quot; fields on arrays, but how else can you uniquely identify an array element if not by it&apos;s index. &lt;/p&gt;</comment>
                            <comment id="617706" author="albert@suretybonds.com" created="Wed, 11 Jun 2014 21:07:29 +0000"  >&lt;p&gt;+1&lt;/p&gt;

&lt;p&gt;TIL it&apos;s not possible to remove an array based on its index.&lt;/p&gt;

&lt;p&gt;Yes, there&apos;s a possible race condition by doing it like that.  But it&apos;s a pretty basic use-case for MongoDB (especially in use-cases where a race condition would have no impact).&lt;/p&gt;</comment>
                            <comment id="477345" author="loki5100" created="Sun, 5 Jan 2014 13:49:27 +0000"  >&lt;p&gt;hello, for me too this is a big hole !&lt;/p&gt;</comment>
                            <comment id="467618" author="threadfinder" created="Mon, 9 Dec 2013 05:22:17 +0000"  >&lt;p&gt;@Eliot and update on @Jiao&apos;s pull request (if he ever made one?). Would love to see this implemented, this is a big hole in MongoDB for me.&lt;/p&gt;</comment>
                            <comment id="115449" author="jpfarias" created="Wed, 2 May 2012 03:17:41 +0000"  >&lt;p&gt;A sample usage would be like:&lt;/p&gt;

&lt;p&gt;$ mongo localhost/test&lt;br/&gt;
MongoDB shell version: 2.0.4&lt;br/&gt;
connecting to: localhost/test&lt;br/&gt;
&amp;gt; db.test.insert(&lt;/p&gt;
{x: 1, y: [1, 2, 3, 4, 5, 6]}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.test.update(&lt;/p&gt;
{x: 1}
&lt;p&gt;, {$pop: {y: -2}})&lt;br/&gt;
&amp;gt; db.test.findOne()&lt;br/&gt;
{&lt;br/&gt;
	&quot;_id&quot; : ObjectId(&quot;4fa0a66b6b27d2c6bac971a2&quot;),&lt;br/&gt;
	&quot;x&quot; : 1,&lt;br/&gt;
	&quot;y&quot; : [&lt;br/&gt;
		1,&lt;br/&gt;
		3,&lt;br/&gt;
		4,&lt;br/&gt;
		5,&lt;br/&gt;
		6&lt;br/&gt;
	]&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; db.test.update(&lt;/p&gt;
{x: 1}
&lt;p&gt;, {$pop: {y: 2}})&lt;br/&gt;
&amp;gt; db.test.findOne()&lt;br/&gt;
{&lt;br/&gt;
	&quot;_id&quot; : ObjectId(&quot;4fa0a66b6b27d2c6bac971a2&quot;),&lt;br/&gt;
	&quot;x&quot; : 1,&lt;br/&gt;
	&quot;y&quot; : [&lt;br/&gt;
		1,&lt;br/&gt;
		3,&lt;br/&gt;
		4,&lt;br/&gt;
		6&lt;br/&gt;
	]&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;As Wouter suggested on a previous comment. It was quite easy to implement this, perhaps it was not the best way but sounds like a good idea to have a &quot;remove from array&quot; operation that can remove with an index based parameter. Actually, I was surprised that such a feature didn&apos;t exist already.&lt;/p&gt;</comment>
                            <comment id="115440" author="eliot" created="Wed, 2 May 2012 02:15:44 +0000"  >&lt;p&gt;@joao - not sure this makes sense as is.&lt;br/&gt;
Can you add some tests and a spec so we can see exactly what you intend?&lt;/p&gt;</comment>
                            <comment id="115380" author="jpfarias" created="Tue, 1 May 2012 22:26:45 +0000"  >&lt;p&gt;I just sent a pull request on github and accepted the contributor terms. Thanks, --JP&lt;/p&gt;
</comment>
                            <comment id="115365" author="ian@10gen.com" created="Tue, 1 May 2012 21:52:26 +0000"  >&lt;p&gt;@Joao, when possible we handle all patch contributions via Github pull requests.  It would be great if you could open up a pull request against the primary repo at &lt;a href=&quot;https://github.com/mongodb/mongo&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo&lt;/a&gt;, and also read + sign the contributor agreement at &lt;a href=&quot;http://www.10gen.com/contributor&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.10gen.com/contributor&lt;/a&gt;.  Once you&apos;ve done that I&apos;ll be able to get an engineer to start reviewing your patch.&lt;/p&gt;</comment>
                            <comment id="115354" author="jpfarias" created="Tue, 1 May 2012 21:36:47 +0000"  >&lt;p&gt;This patch was written agains r2.0.4 and allows pop to remove an element by its index.&lt;/p&gt;

&lt;p&gt;To keep backward compatibility, I made it so -N removes from beginning and N removes from the end.&lt;/p&gt;

&lt;p&gt;In case the absolute value of N is greater than the array size, no elements are removed.&lt;/p&gt;

&lt;p&gt;For instance, $pop with -1 removes the last element, unless the array is empty, in which case nothing is changed.&lt;/p&gt;

&lt;p&gt;This is a pretty simple patch and I hope to see that in the next realeases of mongo.&lt;/p&gt;</comment>
                            <comment id="13660" author="wouter" created="Thu, 15 Apr 2010 09:30:05 +0000"  >&lt;p&gt;&amp;gt; If $unset did not leave nulls then the array index&apos;s would change&lt;/p&gt;

&lt;p&gt;Therefore a separate modifier?!&lt;/p&gt;

&lt;p&gt;&amp;gt; db.example.update({_id:1}, { $remove : { &apos;sequence.1&apos; : 1 }})&lt;/p&gt;

&lt;p&gt;Or modify $pop, so that it takes an index&lt;/p&gt;

&lt;p&gt;&amp;gt; db.example.update({_id:1}, { $pop : { &apos;sequence&apos; : 4 }}) &lt;/p&gt;

&lt;p&gt;Or to remain backwards compatibility&lt;/p&gt;

&lt;p&gt;&amp;gt; db.example.update({_id:1}, { $pop : { &apos;sequence&apos; : N }}) &lt;br/&gt;
with:&lt;br/&gt;
N &amp;gt; 0 --&amp;gt; N&apos;th value starting from end of set&lt;br/&gt;
N &amp;lt; 0 --&amp;gt; N&apos;th value starting from beginning of set&lt;/p&gt;</comment>
                            <comment id="13659" author="coenhyde" created="Thu, 15 Apr 2010 03:53:17 +0000"  >&lt;p&gt;Maybe just engineer your application to gracefully deal with null&apos;s. I initially didn&apos;t like the fact that $unset left nulls but there is a reason ... If $unset did not leave nulls then the array index&apos;s would change. This may sound good, but if you have a lot of concurrent update queries going on, an update request may accidentally update the wrong array element. Well i assume this is the reason why nulls are left. Plus it&apos;s probably quicker to just leave null&apos;s in place,.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="28565">SERVER-4708</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="13576">SERVER-2036</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="45148">SERVER-6566</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="13143">SERVER-1824</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="43910">SERVER-6399</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="16350" name="update.patch" size="1922" author="jpfarias" created="Tue, 1 May 2012 21:36:47 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>33.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25143"><![CDATA[Query]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 15 Apr 2010 03:53:17 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 51 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>
                            3 years, 51 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>4F2E4A2E</customfieldvalue>
            <customfieldvalue>albert@suretybonds.com</customfieldvalue>
            <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-server-query</customfieldvalue>
            <customfieldvalue>derelinguo</customfieldvalue>
            <customfieldvalue>cf@truemarketllc.com</customfieldvalue>
            <customfieldvalue>coenhyde</customfieldvalue>
            <customfieldvalue>ylmbtm</customfieldvalue>
            <customfieldvalue>desfenfe</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>ethanfar</customfieldvalue>
            <customfieldvalue>sambugj</customfieldvalue>
            <customfieldvalue>fusername</customfieldvalue>
            <customfieldvalue>ian@mongodb.com</customfieldvalue>
            <customfieldvalue>isole</customfieldvalue>
            <customfieldvalue>cherviakov.ivan@gmail.com</customfieldvalue>
            <customfieldvalue>threadfinder</customfieldvalue>
            <customfieldvalue>jpp</customfieldvalue>
            <customfieldvalue>jpfarias</customfieldvalue>
            <customfieldvalue>jb_sulli</customfieldvalue>
            <customfieldvalue>Meruem</customfieldvalue>
            <customfieldvalue>nachiketg</customfieldvalue>
            <customfieldvalue>rannooo</customfieldvalue>
            <customfieldvalue>rcardin</customfieldvalue>
            <customfieldvalue>bgsosh@gmail.com</customfieldvalue>
            <customfieldvalue>loki5100</customfieldvalue>
            <customfieldvalue>wouter</customfieldvalue>
            <customfieldvalue>pudility</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrp46n:</customfieldvalue>

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

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

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