<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:55:17 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-831] Positional Operator Matching Nested Arrays</title>
                <link>https://jira.mongodb.org/browse/SERVER-831</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;div class=&quot;panel&quot; style=&quot;background-color: #EEEEEE;border-color: #ccc;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-color: #ccc;background-color: #6CB33F;&quot;&gt;&lt;b&gt;Issue Status as of Aug 11, 2017&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #EEEEEE;&quot;&gt;
&lt;p&gt;&lt;b&gt;FEATURE DESCRIPTION&lt;/b&gt;&lt;br/&gt;
MongoDB 3.5.12 extends all update modifiers to apply to all array elements or all array elements that match a predicate, specified in a new &lt;tt&gt;update&lt;/tt&gt; option &lt;tt&gt;arrayFilters&lt;/tt&gt;. This syntax also supports nested array elements.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;VERSIONS&lt;/b&gt;&lt;br/&gt;
This new feature is available starting with the MongoDB 3.5.12 development version, and included in the MongoDB 3.6 production version.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;OPERATION&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update all documents in array&lt;/b&gt;&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.coll.update({}, {$set: {&#8220;a.$[].b&#8221;: 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;Input: {a: [{b: 0}, {b: 1}]}&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;Output: {a: [{b: 2}, {b: 2}]}&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;&lt;b&gt;Update all matching documents in array&lt;/b&gt;&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.coll.update({}, {$set: {&#8220;a.$[i].b&#8221;: 2}}, {arrayFilters: [{&#8220;i.b&#8221;: 0}]})&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;Input: {a: [{b: 0}, {b: 1}]}&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;Output: {a: [{b: 2}, {b: 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;

&lt;p&gt;&lt;b&gt;Update all matching scalars in array&lt;/b&gt;&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.coll.update({}, {$set: {&#8220;a.$[i]&#8221;: 2}}, {arrayFilters: [{i: 0}]})&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;Input: {a: [0, 1]}&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;Output: {a: [2, 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;

&lt;p&gt;&lt;b&gt;Update all matching documents in nested array&lt;/b&gt;&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.coll.update({}, {$set: {&#8220;a.$[i].c.$[j].d&#8221;: 2}}, {arrayFilters: [{&#8220;i.b&#8221;: 0}, {&#8220;j.d&#8221;: 0}]})&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;Input: {a: [{b: 0, c: [{d: 0}, {d: 1}]}, {b: 1, c: [{d: 0}, {d: 1}]}]}&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;Output: {a: [{b: 0, c: [{d: 2}, {d: 1}]}, {b: 1, c: [{d: 0}, {d: 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;

&lt;p&gt;&lt;b&gt;Update all scalars in array matching a logical predicate&lt;/b&gt;&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.coll.update({}, {$set: {&#8220;a.$[i]&#8221;: 2}}, {arrayFilters: [{$or: [{i: 0}, {i: 3}]}]})&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;Input: {a: [0, 1, 3]}&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;Output: {a: [2, 1, 2]}&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;Each array filter must be a predicate over a document with a single field name. Each array filter must be used in the update expression, and each array filter identifier &lt;tt&gt;$[&amp;lt;id&amp;gt;]&lt;/tt&gt; must have a corresponding array filter. &lt;tt&gt;&amp;lt;id&amp;gt;&lt;/tt&gt; must begin with a lowercase letter and not contain any special characters. There must not be two array filters with the same field name.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;IMPLEMENTATION DETAILS&lt;/b&gt;&lt;br/&gt;
The implementation of this feature involved a rewrite of the update system. Users can &lt;a href=&quot;https://jira.mongodb.org/issues/?jql=key%20in%20(SERVER-30401%2CSERVER-29912%2CSERVER-29840%2CSERVER-29819%2CSERVER-29762%2CSERVER-29162%2CSERVER-28778%2CSERVER-28777%2CSERVER-28776%2CSERVER-28775%2CSERVER-28774%2CSERVER-28773%2CSERVER-28772%2CSERVER-28771%2CSERVER-28770%2CSERVER-28769%2CSERVER-28768%2CSERVER-28767%2CSERVER-28766%2CSERVER-28765%2CSERVER-28764%2CSERVER-28763%2CSERVER-28762%2CSERVER-28761%2CSERVER-28759%2CSERVER-28758%2CSERVER-28757%2CSERVER-28621%2CSERVER-28577%2CSERVER-28576%2CSERVER-28575%2CSERVER-28478%2CSERVER-27738%2CSERVER-27089%2CSERVER-25717)&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;find all the related tickets here&lt;/a&gt;. The design document is attached.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h6&gt;&lt;a name=&quot;Originaldescription&quot;&gt;&lt;/a&gt;Original description&lt;/h6&gt;</description>
                <environment></environment>
        <key id="11619">SERVER-831</key>
            <summary>Positional Operator Matching Nested Arrays</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="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="tess.avitabile@mongodb.com">Tess Avitabile</assignee>
                                    <reporter username="durran">Durran Jordan</reporter>
                        <labels>
                    </labels>
                <created>Thu, 25 Mar 2010 16:08:08 +0000</created>
                <updated>Thu, 6 Apr 2023 15:39:08 +0000</updated>
                            <resolved>Fri, 11 Aug 2017 21:00:44 +0000</resolved>
                                                    <fixVersion>3.5.12</fixVersion>
                                    <component>Querying</component>
                    <component>Write Ops</component>
                                        <votes>351</votes>
                                    <watches>286</watches>
                                                                                                                <comments>
                            <comment id="1681027" author="jesse" created="Mon, 25 Sep 2017 16:59:09 +0000"  >&lt;p&gt;Related change to drivers&apos; CRUD API spec:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/specifications/commit/a7bd3766306ff9150fdc042844512562d400b288&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/specifications/commit/a7bd3766306ff9150fdc042844512562d400b288&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Summary: the updateOne and updateMany methods get a new optional parameter &quot;arrayFilters&quot; that accepts the document in the server&apos;s syntax.&lt;/p&gt;</comment>
                            <comment id="1680180" author="alexreg" created="Sat, 23 Sep 2017 14:15:34 +0000"  >&lt;p&gt;Is there equivalent syntax for this in C# using LINQ/fluent queries?&lt;/p&gt;</comment>
                            <comment id="1601916" author="alice@gothcandy.com" created="Tue, 20 Jun 2017 17:46:01 +0000"  >&lt;p&gt;A solution: awesome.  Looking forward to it.  Curious syntax, though.  Named references are cool, but why the braces?  Are &lt;tt&gt;$name&lt;/tt&gt; references within a longer field reference currently reserved?  E.g. {&lt;tt&gt;$set: {&quot;a.$i.b.$j.c&quot;: 5&lt;/tt&gt;}} (edge case: {&lt;tt&gt;$set: {&quot;$i&quot;: 5&lt;/tt&gt;}})  AFIK &lt;tt&gt;$&lt;/tt&gt; is not allowed in saved field names.  It just seems a strange departure from otherwise minimal &quot;glue&quot; syntax.&lt;/p&gt;</comment>
                            <comment id="1601905" author="murilolobatto" created="Tue, 20 Jun 2017 17:34:16 +0000"  >&lt;p&gt;This is great news! I&apos;m really dependent of this feature.&lt;/p&gt;</comment>
                            <comment id="1601738" author="asya" created="Tue, 20 Jun 2017 14:37:23 +0000"  >&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;We are currently making progress on a solution to this issue under &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27089&quot; title=&quot;Extend the update subsystem to support more expressive updates to array fields&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27089&quot;&gt;&lt;del&gt;SERVER-27089&lt;/del&gt;&lt;/a&gt;. Since this feature is still in development, and not yet switched on in a development release, we don&apos;t yet have documentation for how it will work. But to give you a quick preview, you will be able to update values and subdocuments inside nested array(s) as follows:&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.coll.update({}, {$set: {&quot;a.$[i].b.$[j].c&quot;: 5}},  {arrayFilters: [{&quot;i.id&quot;: 1},{&quot;j.c&quot;:1]});&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;Input: {a: [{id:1, b: [{c: 0},{c:1}]]}&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;Output: {a: [{id:1, b: {[c:0},{c:5}]]}&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;We will post a more formal update on &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27089&quot; title=&quot;Extend the update subsystem to support more expressive updates to array fields&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27089&quot;&gt;&lt;del&gt;SERVER-27089&lt;/del&gt;&lt;/a&gt; when this work is complete.&lt;/p&gt;

&lt;p&gt;Best,&lt;br/&gt;
Asya&lt;/p&gt;</comment>
                            <comment id="1591927" author="katakam.maniratnam@gmail.com" created="Fri, 9 Jun 2017 05:25:20 +0000"  >&lt;p&gt;Hello All,&lt;/p&gt;

&lt;p&gt;I have a similar situation I guess, the following is the sample Json document in which I need to query on.&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
    &quot;_id&quot; : ObjectId(&quot;591d601fc9f360331cd4668c&quot;),&lt;br/&gt;
    &quot;Type&quot; : &quot;district&quot;,&lt;br/&gt;
    &quot;GroupId&quot; : &quot;00000000-0000-0000-0000-000000000456&quot;,&lt;br/&gt;
    &quot;Grades&quot; : [ &lt;br/&gt;
        {&lt;br/&gt;
            &quot;GroupId&quot; : &quot;gs00000000-0000-0000-0000-000000000452&quot;,&lt;br/&gt;
            &quot;Categories&quot; : [ &lt;br/&gt;
                &lt;/p&gt;
{
                    &quot;Sequence&quot; : 1,
                    &quot;Low&quot; : 0,
                    &quot;High&quot; : 99,
                    &quot;Min&quot; : 0,
                    &quot;Max&quot; : 0,
                }
&lt;p&gt;, &lt;/p&gt;
				 {
                    &quot;Sequence&quot; : 1,
                    &quot;Low&quot; : 50,
                    &quot;High&quot; : 99,
                    &quot;Min&quot; : 0,
                    &quot;Max&quot; : 0,
                }
&lt;p&gt;            ]&lt;br/&gt;
        }&lt;br/&gt;
    ],&lt;br/&gt;
    &quot;NumberOfTypes&quot; : 4,&lt;br/&gt;
    &quot;CreatedDate&quot; : ISODate(&quot;2017-05-18T08:49:35.433Z&quot;),&lt;br/&gt;
    &quot;LastModifiedDate&quot; : ISODate(&quot;2017-05-26T16:12:52.093Z&quot;),&lt;br/&gt;
    &quot;Status&quot; : true&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;I need to pick all the document where the value of &quot;Low&quot;: 0 and change to 1. I am trying the following query &lt;/p&gt;

&lt;p&gt;db.BenchmarkDetails.update(&lt;br/&gt;
    &lt;/p&gt;
{&quot;Grades.Categories.Low&quot; : 0}
&lt;p&gt;,&lt;br/&gt;
    {$set : &lt;/p&gt;
            {&quot;Grades.Categories.$.Low&quot; : 1}
&lt;p&gt;     }&lt;br/&gt;
     )&lt;/p&gt;

&lt;p&gt;This throwing the error&lt;/p&gt;

&lt;p&gt;cannot use the part (Grades of Grades.Categories.0.Low) to traverse the element.&lt;/p&gt;</comment>
                            <comment id="1574193" author="ketannaik" created="Thu, 18 May 2017 09:13:35 +0000"  >&lt;p&gt;@Yannick Betemps: Unfortunately even that does not work &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="1574170" author="arkhee" created="Thu, 18 May 2017 08:19:43 +0000"  >&lt;p&gt;Have you tried using only one $ : the one of the $elemMatch subarray ?&lt;/p&gt;</comment>
                            <comment id="1574168" author="ketannaik" created="Thu, 18 May 2017 08:10:49 +0000"  >&lt;p&gt;@Yannick Betemps: &lt;br/&gt;
You understood it properly.&lt;br/&gt;
Multiple Positional operators are not supported in MongoDB yet.&lt;br/&gt;
so 2 $ sign in a sign query wont work &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="1574165" author="arkhee" created="Thu, 18 May 2017 07:54:57 +0000"  >&lt;p&gt;@Ketan&lt;br/&gt;
Not sure since it&apos;s not an object and in subsub array, I would try :&lt;/p&gt;

&lt;p&gt;db.mycollection.update({&apos;sections.skills&apos;:{$elemMatch:&lt;/p&gt;
{&apos;Videos&apos;:ObjectId(&quot;57973ff97c516c2b44209fb3&quot;)}
&lt;p&gt;}}, &lt;br/&gt;
            			{ $pull: { &quot;sections.$.skills.$.Videos&quot;: ObjectId(&quot;57973ff97c516c2b44209fb3&quot;)}}&lt;br/&gt;
						&lt;/p&gt;
{upsert:false,multi:false}
&lt;p&gt; // change only one found value&lt;br/&gt;
					);&lt;br/&gt;
maybe try to create Videos as one-property object ?&lt;br/&gt;
$pull allows to remove a specific item in an array, whereas the $elemMatch allows to target the right node (since the video may be in other skills or sections), as I understand it&lt;/p&gt;

&lt;p&gt;playing with dots and $ ... this is more of an experimental research here ... work on dev collection &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/wink.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="1574160" author="ketannaik" created="Thu, 18 May 2017 07:43:33 +0000"  >&lt;p&gt;@Yannick Betemps: &lt;/p&gt;

&lt;p&gt;My collection is as follows:&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
    &quot;_id&quot; : ObjectId(&quot;579f05e415d47c452d6d4707&quot;),&lt;br/&gt;
    &quot;moduleId&quot; : ObjectId(&quot;579f05e415d47c452d6d4706&quot;),&lt;br/&gt;
    &quot;canDelete&quot; : true,&lt;br/&gt;
    &quot;sections&quot; : [ &lt;br/&gt;
        {&lt;br/&gt;
            &quot;sectionId&quot; : ObjectId(&quot;57973f9b7c516c2b44209d4f&quot;),&lt;br/&gt;
            &quot;_id&quot; : ObjectId(&quot;579f05e415d47c452d6d4713&quot;),&lt;br/&gt;
            &quot;skills&quot; : [ &lt;br/&gt;
                &lt;/p&gt;
{
                    &quot;skillId&quot; : ObjectId(&quot;57973fca7c516c2b44209d5b&quot;),
                    &quot;_id&quot; : ObjectId(&quot;579740267c516c2b4420a090&quot;),
                    &quot;Videos&quot; : [ 
                        ObjectId(&quot;57973ff97c516c2b44209fb3&quot;), 
                       *_ ObjectId(&quot;591d40bc3162bc4012ebd1c6&quot;)_*
                    ],
                    &quot;Questions&quot; : [ 
                        ObjectId(&quot;57973fe77c516c2b44209dbf&quot;), 
                        ObjectId(&quot;57973fe77c516c2b44209dc0&quot;), 
                        ObjectId(&quot;57973fe77c516c2b44209dc1&quot;), 
                        ObjectId(&quot;57973fe77c516c2b44209dc2&quot;), 
                        ObjectId(&quot;57973fe77c516c2b44209dc3&quot;)
                    ]
                }
&lt;p&gt;, &lt;/p&gt;
                {
                    &quot;skillId&quot; : ObjectId(&quot;57973fca7c516c2b44209d5c&quot;),
                    &quot;_id&quot; : ObjectId(&quot;579740267c516c2b4420a08f&quot;),
                    &quot;Videos&quot; : [ 
                        ObjectId(&quot;57973ff97c516c2b44209fb4&quot;)
                    ],
                    &quot;Questions&quot; : [ 
                        ObjectId(&quot;57973fe77c516c2b44209dc4&quot;), 
                        ObjectId(&quot;57973fe77c516c2b44209dc5&quot;), 
                        ObjectId(&quot;57973fe77c516c2b44209dc6&quot;), 
                        ObjectId(&quot;57973fe77c516c2b44209dc7&quot;), 
                        ObjectId(&quot;57973fe77c516c2b44209dc8&quot;)
                    ]
                }
&lt;p&gt;            ]&lt;br/&gt;
        }&lt;br/&gt;
    ]&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;I need to remove ObjectId(&quot;591d40bc3162bc4012ebd1c6&quot;) from Section ---&amp;gt; Skills --&amp;gt; Video array&lt;/p&gt;</comment>
                            <comment id="1574157" author="arkhee" created="Thu, 18 May 2017 07:34:55 +0000"  >&lt;p&gt;@Ketan : regarding a workaround&lt;br/&gt;
Since I was not confident in using index value from the beginning, I inserted a unique mongoid for each entry of each array in my collection, so that I can update a specific entry if needed :&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.mycollection.update({&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&apos;pictures&apos;&lt;/span&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;:{$elemMatch:{&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&apos;id&apos;&lt;/span&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;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;aeaeaeaeaeaeab11b11b11&quot;&lt;/span&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;span style=&quot;color: #008200; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;// Search for specific subitem value&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; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 			{$set:{&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&apos;pictures.$.url&apos;&lt;/span&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;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&apos;http://foobar&apos;&lt;/span&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;}} // Modify specific value of object in array&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;						{upsert:&lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;false&lt;/span&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;,multi:&lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;false&lt;/span&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;span style=&quot;color: #008200; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;// change only one found value&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;off cours this works only if you store objects into arrays, not scalar values.&lt;/p&gt;</comment>
                            <comment id="1574137" author="ketannaik" created="Thu, 18 May 2017 06:49:31 +0000"  >&lt;p&gt;any workaround for this issue?&lt;/p&gt;</comment>
                            <comment id="1495286" author="guihgo" created="Wed, 8 Feb 2017 20:18:43 +0000"  >&lt;p&gt;at end, i &apos;m not using mysql.. I have to use embed collections and use agregate for get values from two collections... MONGODB IS THE BEST &amp;lt;3&lt;/p&gt;</comment>
                            <comment id="1476995" author="mercmobily" created="Sun, 15 Jan 2017 04:32:01 +0000"  >&lt;p&gt;Don&apos;t forget to place your bets!!&lt;/p&gt;

</comment>
                            <comment id="1476993" author="guihgo" created="Sun, 15 Jan 2017 03:48:20 +0000"  >&lt;p&gt;@Tony Mobily -&amp;gt; i think that better change to good and old MySQL hehehe&lt;/p&gt;</comment>
                            <comment id="1476217" author="mercmobily" created="Fri, 13 Jan 2017 08:24:02 +0000"  >&lt;p&gt;I am taking bets. I put $20 that this will be here in 2019, open. Takers?&lt;/p&gt;

</comment>
                            <comment id="1476216" author="guihgo" created="Fri, 13 Jan 2017 08:14:28 +0000"  >&lt;p&gt;2017 and nothing.. &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;:&lt;/p&gt;</comment>
                            <comment id="1450891" author="asya" created="Tue, 6 Dec 2016 23:54:22 +0000"  >&lt;p&gt;Hi All,&lt;/p&gt;

&lt;p&gt;We recognize that this feature is highly requested by the community; we are investigating implementation approaches and considering designs for the required query language extensions in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27089&quot; title=&quot;Extend the update subsystem to support more expressive updates to array fields&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27089&quot;&gt;&lt;del&gt;SERVER-27089&lt;/del&gt;&lt;/a&gt;. We appreciate the challenge of maintaining applications with schemas including large arrays, and the work described in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27089&quot; title=&quot;Extend the update subsystem to support more expressive updates to array fields&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27089&quot;&gt;&lt;del&gt;SERVER-27089&lt;/del&gt;&lt;/a&gt; includes this feature request as well as other related improvements to array update capabilities. Please feel free to review &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27089&quot; title=&quot;Extend the update subsystem to support more expressive updates to array fields&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27089&quot;&gt;&lt;del&gt;SERVER-27089&lt;/del&gt;&lt;/a&gt; for additional details around the requirements of this work and watch it for updates.&lt;/p&gt;

&lt;p&gt;Asya Kamsky&lt;br/&gt;
Lead Product Manager&lt;br/&gt;
MongoDB Server&lt;/p&gt;</comment>
                            <comment id="1424080" author="freddy.loeckli" created="Wed, 2 Nov 2016 16:01:56 +0000"  >&lt;p&gt;please, I need this feature!&lt;/p&gt;</comment>
                            <comment id="1423962" author="samiten" created="Wed, 2 Nov 2016 14:52:56 +0000"  >&lt;p&gt;Hello issue &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-831&quot; title=&quot;Positional Operator Matching Nested Arrays&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-831&quot;&gt;&lt;del&gt;SERVER-831&lt;/del&gt;&lt;/a&gt;, my old friend. &lt;br/&gt;
Would be nice to have a status update from the MongoDB Team. &lt;/p&gt;</comment>
                            <comment id="1422682" author="wir33658" created="Tue, 1 Nov 2016 10:01:51 +0000"  >&lt;p&gt;This would be a greate improvement and would feel natural and expected.&lt;/p&gt;</comment>
                            <comment id="1420977" author="sparshy" created="Fri, 28 Oct 2016 19:46:37 +0000"  >&lt;p&gt;I gave up hope somewhere around late 2014, the fact this is MAJOR and due for past 6 years. Whatever happens to low priorities &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="1420970" author="vizsla" created="Fri, 28 Oct 2016 19:42:23 +0000"  >&lt;p&gt;I too would like to see this happen.&lt;/p&gt;</comment>
                            <comment id="1419337" author="testversion10" created="Thu, 27 Oct 2016 12:25:09 +0000"  >&lt;p&gt;*&lt;b&gt;ignoring the community&lt;/b&gt;*&lt;br/&gt;
very disappointing mongodb!&lt;/p&gt;</comment>
                            <comment id="1416732" author="ivan.fioravanti@4ward.it" created="Tue, 25 Oct 2016 13:46:04 +0000"  >&lt;p&gt;Any news on this one? Will this be part of 3.4 release?&lt;/p&gt;</comment>
                            <comment id="1413464" author="hanspetee" created="Thu, 20 Oct 2016 09:21:33 +0000"  >&lt;p&gt;We got stuck several times on this. It would be great to have some updates. If this is not fixable or needs a lot more time, please let us know, so that we can switch to another technology. &lt;/p&gt;</comment>
                            <comment id="1389567" author="pozdnyakov.asp" created="Wed, 21 Sep 2016 08:18:41 +0000"  >&lt;p&gt;I very want this feature... &lt;br/&gt;
how soon it will be done?&lt;/p&gt;</comment>
                            <comment id="1377115" author="danirod" created="Tue, 6 Sep 2016 13:22:10 +0000"  >&lt;p&gt;I got bitten by this sneaky limitation too. So much for atomic updates...&lt;/p&gt;

&lt;p&gt;And it has priority &quot;Major&quot; WTF?????&lt;/p&gt;</comment>
                            <comment id="1368348" author="jmccormick.me" created="Thu, 25 Aug 2016 21:04:39 +0000"  >&lt;p&gt;&amp;gt; Commonly requested feature issues like these... open since 2010, that&apos;s getting a bit ridiculous.&lt;/p&gt;

&lt;p&gt;No kidding. 6 years? Really Mongo?&lt;/p&gt;</comment>
                            <comment id="1354856" author="secr3t0" created="Thu, 11 Aug 2016 23:02:09 +0000"  >&lt;p&gt;I&apos;ll have to add +1 to this. &lt;/p&gt;

&lt;p&gt;It&apos;s nasty that this is not available. &lt;/p&gt;

&lt;p&gt;As stated by others, we know things can be moved to different collections, but atomic updates are no longer possible. &lt;/p&gt;

&lt;p&gt;Plus I don&apos;t think a DB limitation should be a valid reason to move things to different collections. If updating a document with two levels of arrays atomically is not possible in a clean and elegant way then what&apos;s the point ?&lt;/p&gt;

&lt;p&gt;Is anyone on the team still looking at this ? Could you please give us some info ?&lt;/p&gt;
</comment>
                            <comment id="1349634" author="adambuczynski" created="Sun, 7 Aug 2016 23:28:55 +0000"  >&lt;p&gt;No word since 2014 then? This issue, along with &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1243&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-1243&lt;/a&gt; are really preventing efficient data structures and update queries...&lt;/p&gt;

&lt;p&gt;&amp;gt; I think this is getting silly, but I start to wonder about the state of MongoDB development. Really.&lt;/p&gt;

&lt;p&gt;Agreed. I am now strongly considering to try a different NoSQL DB for my next project.&lt;br/&gt;
Commonly requested feature issues like these... open since 2010, that&apos;s getting a bit ridiculous.&lt;/p&gt;</comment>
                            <comment id="1291997" author="vijaychow7@gmail.com" created="Mon, 13 Jun 2016 13:19:20 +0000"  >&lt;p&gt;it is much needed feature and should be implemented as soon as possible.&lt;/p&gt;</comment>
                            <comment id="1245461" author="jlaustill@gmail.com" created="Mon, 25 Apr 2016 15:26:54 +0000"  >&lt;p&gt;I can&apos;t believe this is a thing.  Has there been any updates since 2014 from the MongoDB team?&lt;/p&gt;</comment>
                            <comment id="1201713" author="isole" created="Sun, 13 Mar 2016 13:12:15 +0000"  >&lt;p&gt;Well, I am still using MongoDB for a weekend project and I had this requirement. This issue just made me to take a step back and re-think my data model. I restructured it, and it worked. No big deal for a weekend project, but it could result  to a headache for a company.&lt;/p&gt;</comment>
                            <comment id="1199763" author="mercmobily" created="Thu, 10 Mar 2016 22:29:35 +0000"  >&lt;p&gt;I haven&apos;t moved away but I too keep on watching the 5 or 6 features that are &lt;em&gt;amusingly&lt;/em&gt; missing at this point; I am using MongoDb, but only with 1-depth tables which is kind of ridiculous.&lt;br/&gt;
Alberto Lerner, who has since left MongoDb, wrote in 2013:&lt;/p&gt;

&lt;p&gt;&amp;gt; This is a feature we&apos;re certainly going to be tackling. Right now, there is a large reorganization effort involving the code that this feature sits atop. The effort is in an advanced stage, even if the resulting code only started to make it to the code base. Giving a precise time now is risky, but we&apos;re optimistic that most, if not all, what&apos;s necessary would be in place in the development cycle starting after 2.4 will be released (so, potentially in the 2.6 product).&lt;/p&gt;

&lt;p&gt;Then Sam Weaver in 2014:&lt;/p&gt;

&lt;p&gt;&amp;gt; Whilst we were keen to get this feature into 2.8, it unfortunately didn&apos;t make the cut. We understand there are a lot of votes and watchers on this ticket and its very highly desired. Rest assured we are addressing the state of this ticket, but in the mean time I have moved this to 2.9 desired. Thank you for your understanding.&lt;/p&gt;

&lt;p&gt;I think this is getting silly, but I start to wonder about the state of MongoDB development. Really.&lt;/p&gt;</comment>
                            <comment id="1199462" author="akhodakivskiy" created="Thu, 10 Mar 2016 19:08:40 +0000"  >&lt;p&gt;I moved away from MongoDB long time ago, but I keep the subscription to this ticket - 6 years and going strong!&lt;/p&gt;</comment>
                            <comment id="1125908" author="mikewasouski" created="Tue, 5 Jan 2016 00:15:15 +0000"  >&lt;p&gt;+1, I nested 3 levels thinking I won&apos;t need to update, suddenly I need to do it in the deepest branch and using a double for to go into the collection and then doing a complete update works but is not a nice and clean option, though.&lt;/p&gt;</comment>
                            <comment id="1111315" author="mhc" created="Thu, 10 Dec 2015 21:04:17 +0000"  >&lt;p&gt;Has come upon this problem on version 3.0&lt;br/&gt;
we nest our solution in 3 levels, and several threads are updating the model with atomic seperate operations, so when this is not implemented, it introduces race conditions, where state can be overridden because it was updated after one thread receives the object from mongo untill it is updated in mongodb&lt;br/&gt;
+1 to fix this&lt;/p&gt;</comment>
                            <comment id="1089072" author="sanderdn" created="Mon, 16 Nov 2015 12:14:22 +0000"  >&lt;p&gt;+1&lt;/p&gt;</comment>
                            <comment id="1088865" author="ylmbtm" created="Mon, 16 Nov 2015 02:34:53 +0000"  >&lt;p&gt;no need too far ,two will be enough&lt;/p&gt;</comment>
                            <comment id="1088864" author="ylmbtm" created="Mon, 16 Nov 2015 02:31:53 +0000"  >&lt;p&gt;+1 need please finish this feature!!&lt;/p&gt;</comment>
                            <comment id="1049780" author="tolgaevcimen" created="Fri, 2 Oct 2015 13:54:45 +0000"  >&lt;p&gt;It is version 3.0 now, and this feature still lacks? I convinced my team to convert to mongodb. We have redesigned our schemes. We have started to development process with find queries, now we are at updates, and stuck &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; I felt like it&apos;s a shame. Now we will redesign our schemas, and queries too.&lt;/p&gt;</comment>
                            <comment id="1028679" author="isole" created="Mon, 14 Sep 2015 11:25:48 +0000"  >&lt;p&gt;+1&lt;/p&gt;</comment>
                            <comment id="1028678" author="rainerschreiber" created="Mon, 14 Sep 2015 11:22:47 +0000"  >&lt;p&gt;+100, need this asap!&lt;/p&gt;</comment>
                            <comment id="1007143" author="binard" created="Mon, 17 Aug 2015 14:54:55 +0000"  >&lt;p&gt;+1, need !&lt;/p&gt;</comment>
                            <comment id="1006788" author="den43" created="Mon, 17 Aug 2015 02:22:26 +0000"  >&lt;p&gt;+1... also need this&lt;/p&gt;</comment>
                            <comment id="959839" author="mjoyce91" created="Tue, 7 Jul 2015 18:43:15 +0000"  >&lt;p&gt;+1 This is a must&lt;/p&gt;</comment>
                            <comment id="949044" author="prashaantt" created="Wed, 24 Jun 2015 11:04:41 +0000"  >&lt;p&gt;Please, please, please fix this. We have only scant updates from project owners/maintainers throughout the history of this 5 year-old issue, even though one would think the number of +1s on this &amp;#8211; and its importance as being a very crucial reason for using MongoDB &amp;#8211; alone should warrant a P1 or at least a P2 level response.&lt;/p&gt;

&lt;p&gt;Dear devs, please assure us that we can trust you that you indeed desire to fix this in 3.1 at last.&lt;/p&gt;</comment>
                            <comment id="937413" author="mravindrarao" created="Thu, 11 Jun 2015 08:07:03 +0000"  >&lt;p&gt;+1&lt;/p&gt;</comment>
                            <comment id="932429" author="slnowak" created="Fri, 5 Jun 2015 09:38:16 +0000"  >&lt;p&gt;2015, and it still causes problems. I had to redesign my collection to make it works. +1, please fix it.  &lt;/p&gt;</comment>
                            <comment id="921437" author="meghadev" created="Fri, 22 May 2015 11:01:30 +0000"  >&lt;p&gt;Are you guys planning to add support for this anytime soon?? It just seems SO essential for deeply nested documents.&lt;/p&gt;</comment>
                            <comment id="868627" author="a.braun" created="Tue, 31 Mar 2015 06:03:34 +0000"  >&lt;p&gt;I almost feel bad for forgetting this issue&apos;s &lt;b&gt;5th&lt;/b&gt; birthday. Happy belated birthday!&lt;/p&gt;</comment>
                            <comment id="864548" author="wilsondjm" created="Thu, 26 Mar 2015 02:35:09 +0000"  >&lt;p&gt;+1&lt;/p&gt;</comment>
                            <comment id="852379" author="altfatterz" created="Sun, 15 Mar 2015 13:25:27 +0000"  >&lt;p&gt;+1&lt;/p&gt;</comment>
                            <comment id="852042" author="andrew.kalek@anlek.com" created="Fri, 13 Mar 2015 22:32:30 +0000"  >&lt;p&gt;+1&lt;/p&gt;</comment>
                            <comment id="848728" author="jpblair" created="Wed, 11 Mar 2015 13:40:26 +0000"  >&lt;p&gt;+1.  Isn&apos;t one of the main advantages of using Mongo supposed to be the support for nested arrays?&lt;/p&gt;</comment>
                            <comment id="820930" author="shanehou" created="Wed, 4 Feb 2015 06:51:57 +0000"  >&lt;p&gt;So upon the release of 3.0, this feature turned into 3.1 desired... Was this decision based on some data statistics that few people ever need it or was it because of the difficulty to implement?&lt;/p&gt;</comment>
                            <comment id="811967" author="hugh.watkins@ericsson.com" created="Fri, 23 Jan 2015 18:10:49 +0000"  >&lt;p&gt;This request is 5 years old, I seriously doubt it will ever get done.&lt;/p&gt;</comment>
                            <comment id="811879" author="catchamonkey" created="Fri, 23 Jan 2015 17:10:05 +0000"  >&lt;p&gt;Is there any movement on this at all since November?&lt;/p&gt;</comment>
                            <comment id="769752" author="gizmonerd" created="Fri, 21 Nov 2014 04:20:01 +0000"  >&lt;p&gt;+1 really could use this ASAP&lt;/p&gt;</comment>
                            <comment id="765453" author="sam.weaver@10gen.com" created="Sun, 16 Nov 2014 19:44:29 +0000"  >&lt;p&gt;Hello Charlie.&lt;/p&gt;

&lt;p&gt;Whilst we were keen to get this feature into 2.8, it unfortunately didn&apos;t make the cut. We understand there are a lot of votes and watchers on this ticket and its very highly desired. Rest assured we are addressing the state of this ticket, but in the mean time I have moved this to 2.9 desired.&lt;/p&gt;

&lt;p&gt;Thank you for your understanding.&lt;/p&gt;

&lt;p&gt;Kind Regards,&lt;br/&gt;
Sam&lt;/p&gt;</comment>
                            <comment id="763764" author="cstigler" created="Thu, 13 Nov 2014 20:27:00 +0000"  >&lt;p&gt;Questions for any MongoDB folks reading this:&lt;/p&gt;

&lt;p&gt;-Now that 2.8rc0 is out, does that mean this feature will officially not make 2.8?&lt;br/&gt;
-If that&apos;s the case, do things like this get added in minor releases (2.8.1)? Or does that mean this will not come out until at least 2.10?&lt;/p&gt;

&lt;p&gt;Hoping this doesn&apos;t mean another year of waiting.&lt;/p&gt;

&lt;p&gt;(sorry to add to the email spam of +1s, but I thought this was worth asking.))&lt;/p&gt;</comment>
                            <comment id="760313" author="daniel619" created="Mon, 10 Nov 2014 18:14:57 +0000"  >&lt;p&gt;+1 Very useful.&lt;/p&gt;</comment>
                            <comment id="760215" author="5yki" created="Mon, 10 Nov 2014 17:18:31 +0000"  >&lt;p&gt;+1 here, too.&lt;/p&gt;</comment>
                            <comment id="760100" author="richtertk" created="Mon, 10 Nov 2014 15:42:46 +0000"  >&lt;p&gt;+1 We could really use this.&lt;/p&gt;</comment>
                            <comment id="759636" author="awellard" created="Sun, 9 Nov 2014 05:31:10 +0000"  >&lt;p&gt;+1 this as well. This would be a HUGE help. Thanks!&lt;/p&gt;</comment>
                            <comment id="743346" author="bramanga" created="Thu, 16 Oct 2014 18:01:51 +0000"  >&lt;p&gt;+1 on this too. Necessary for one of my company&apos;s use cases.&lt;/p&gt;</comment>
                            <comment id="732294" author="featureme" created="Thu, 2 Oct 2014 09:35:18 +0000"  >&lt;p&gt;I need this feature so much I created an account here just to let you know.&lt;/p&gt;</comment>
                            <comment id="729201" author="gurix" created="Mon, 29 Sep 2014 09:46:49 +0000"  >&lt;p&gt;It turned out that I could use my application unter 2.6 with designing my database better. Now I don&apos;t have any array nesting deeper than 2 levels, but still it feels just not right and at some point the design could need a deeper nesting.&lt;/p&gt;</comment>
                            <comment id="729172" author="codegourmet" created="Mon, 29 Sep 2014 08:11:24 +0000"  >&lt;p&gt;+1 This is a common use case for our applications, and we consider it not being there a near show-stopper.&lt;/p&gt;</comment>
                            <comment id="728924" author="gurix" created="Sun, 28 Sep 2014 11:47:46 +0000"  >&lt;p&gt;+1, I would also appreciate this. All users of Mongoid will get a problem with the positional operator using mongodb 2.6 (&lt;a href=&quot;https://github.com/mongoid/mongoid/issues/3611&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongoid/mongoid/issues/3611&lt;/a&gt;). Breaking backward compatibility is jus not acceptable and this feature could solve this problem. After all I don&apos;t be able to use mongodb from 2.6 so if this does not change I have to switch database.&lt;/p&gt;</comment>
                            <comment id="713000" author="vdaubry" created="Sat, 6 Sep 2014 08:55:19 +0000"  >&lt;p&gt;+1 , as a newcomer to mongodb i almost immediately ran into this issue. This is very deceptive for people evaluating mongo for production use....&lt;/p&gt;</comment>
                            <comment id="705314" author="ashraffayad" created="Wed, 27 Aug 2014 09:45:11 +0000"  >&lt;p&gt;+1 we need this feature too&lt;/p&gt;</comment>
                            <comment id="704643" author="raulgd" created="Tue, 26 Aug 2014 20:17:18 +0000"  >&lt;p&gt;This would be great for our application so +1&lt;/p&gt;

&lt;p&gt;Right now we have an N level binary tree that we store in MongoDB, and to be able to do queries on it, we have to convert and store our tree into a flat list defining each node&apos;s parent relationship and order to be able to use the aggregation framework, so we can convert the list back to a tree when we pull it from MongoDB for rendering in our UI.&lt;/p&gt;

&lt;p&gt;We don&apos;t have that much overhead because we use Java and through HashMaps we can, very quickly and without processing overhead, convert the list to tree and viceversa, but if we want to access the tree from other languanges that don&apos;t have the same facilities as Java (like PHP), then we get major overheads doing that.&lt;/p&gt;

&lt;p&gt;So just having the ability to store the tree as is and query it without having to turn it into a list, would be just awesome.&lt;/p&gt;</comment>
                            <comment id="693493" author="tavacizade" created="Mon, 18 Aug 2014 12:49:03 +0000"  >&lt;p&gt;It&apos;s been 4 years and versions but still there is no improvement about this..&lt;/p&gt;</comment>
                            <comment id="660134" author="wenchenglai" created="Wed, 16 Jul 2014 02:15:08 +0000"  >&lt;p&gt;I need this feature, else I still have to use my SQL db.&lt;/p&gt;</comment>
                            <comment id="651988" author="manjunath.bhuyar@hp.com" created="Tue, 8 Jul 2014 18:26:05 +0000"  >&lt;p&gt;We also need this feature, currently its difficult to edit the production DB &lt;/p&gt;</comment>
                            <comment id="641058" author="basileduplessis" created="Tue, 1 Jul 2014 20:37:06 +0000"  >&lt;p&gt;+1 for me&lt;/p&gt;</comment>
                            <comment id="624972" author="neeraj.wadhwani@glu.com" created="Tue, 17 Jun 2014 18:43:43 +0000"  >&lt;p&gt;+1 ... Please make this happen.&lt;/p&gt;</comment>
                            <comment id="624173" author="wongsolo" created="Tue, 17 Jun 2014 08:20:14 +0000"  >&lt;p&gt;+1 from me. This is what makes mongoDB mongoDB&lt;/p&gt;</comment>
                            <comment id="621620" author="kuentingshiu" created="Sat, 14 Jun 2014 23:12:24 +0000"  >&lt;p&gt;+1 for me! &lt;br/&gt;
The feature of &quot;medications.$.prescriptions.$.quantity&quot; is a must have. Otherwise we will have to abandon using MongoDB!&lt;/p&gt;</comment>
                            <comment id="615210" author="arkhee" created="Tue, 10 Jun 2014 10:13:02 +0000"  >&lt;p&gt;big +1 for me too : this allows to make complex documents easier to maintain, this is also very useful with these document databases where you can not join tables : redundancy sometimes replaces the joints, so this feature makes it easier to maintain redundant data (ex. city / country names embedded in data etc)&lt;/p&gt;</comment>
                            <comment id="608646" author="jeffwhelpley" created="Wed, 4 Jun 2014 21:04:48 +0000"  >&lt;p&gt;Huge +1 for me as well. This is a must have.&lt;/p&gt;</comment>
                            <comment id="604149" author="tjombka" created="Sun, 1 Jun 2014 14:47:50 +0000"  >&lt;p&gt;+1&lt;/p&gt;</comment>
                            <comment id="598210" author="jochan" created="Tue, 27 May 2014 19:05:39 +0000"  >&lt;p&gt;Another +1 for this issue as it allows us to keep things tidy (we don&apos;t have too many levels of nested arrays) in one document.&lt;/p&gt;</comment>
                            <comment id="560183" author="jabclab" created="Wed, 23 Apr 2014 13:06:35 +0000"  >&lt;p&gt;Agree with @Carl Banbury on this one, often this issue means our document readability suffers due to not being able to update the nested arrays.&lt;/p&gt;</comment>
                            <comment id="553235" author="dkmooers" created="Thu, 17 Apr 2014 15:56:34 +0000"  >&lt;p&gt;Yup. I&apos;m now working around it by moving a major sub-collection to its own collection, so I now (luckily) only have to traverse one array level with the positional operator instead of two. Ironically this separate collection works out being a little more flexible for the app I&apos;m working on, but having multiple positional operators still seems like a really killer feature that MongoDB deserves!&lt;/p&gt;</comment>
                            <comment id="553078" author="derelinguo" created="Thu, 17 Apr 2014 14:13:21 +0000"  >&lt;p&gt;Completely agree with Devin. We are basically having to avoid arrays in our documents because of this and other basic functionality missing for arrays.&lt;/p&gt;</comment>
                            <comment id="551891" author="dkmooers" created="Wed, 16 Apr 2014 17:29:14 +0000"  >&lt;p&gt;A big +1 for this issue. The workarounds for modifying many-levels-deep documents are not pretty or fast!&lt;/p&gt;</comment>
                            <comment id="550367" author="rwander" created="Tue, 15 Apr 2014 16:37:49 +0000"  >&lt;p&gt;we are very waiting for this feature!&lt;/p&gt;</comment>
                            <comment id="540883" author="kimshen" created="Tue, 8 Apr 2014 15:46:47 +0000"  >&lt;p&gt;Mark and follow, similar requirement like above&lt;/p&gt;</comment>
                            <comment id="528371" author="kingklaudi" created="Sun, 30 Mar 2014 16:31:34 +0000"  >&lt;p&gt;I agree with @Tony. We are missing this feature since 2010, and is so critical. I can&apos;t believe that this is still unresolved.&lt;/p&gt;</comment>
                            <comment id="506256" author="mercmobily" created="Thu, 27 Feb 2014 09:57:38 +0000"  >&lt;p&gt;I haven&apos;t seen any activity in this for quite a while. This effectively means that deep updates are... well, not possible.&lt;br/&gt;
I see that it&apos;s now marked for 2.7. Can I make a vote, and ask to push it to 2.5 for 2.6?&lt;/p&gt;

&lt;p&gt;I think this feature missing is &lt;em&gt;tragic&lt;/em&gt;.&lt;/p&gt;</comment>
                            <comment id="403600" author="coenhyde" created="Thu, 15 Aug 2013 08:00:59 +0000"  >&lt;p&gt;I agree with @Ezekiel. Keep the format familiar. At the moment I think it is expected that &quot;pets.$.toys.$&quot; syntax should work regardless of any other possible syntax implementations.&lt;/p&gt;</comment>
                            <comment id="403571" author="evictor" created="Thu, 15 Aug 2013 06:52:38 +0000"  >&lt;p&gt;Sorry, that last example is not special; I think you can already do that anyway. Can you show us some ambiguities?&lt;/p&gt;</comment>
                            <comment id="403569" author="evictor" created="Thu, 15 Aug 2013 06:50:01 +0000"  >&lt;p&gt;I think this would be unambiguous:&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;/*&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;Some contrived example:&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;&amp;nbsp;&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;// PetOwner collection&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;    _id: ...,&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;    name: &apos;Bob&apos;,&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;    pets: [&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;        name: &apos;Fluffy&apos;,&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;        animalType: &apos;cat&apos;,&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;        toys: [&apos;string&apos;, &apos;wand&apos;]&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;        name: &apos;Mittens&apos;,&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;        animalType: &apos;cat&apos;,&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;        toys: [&apos;mouse&apos;]&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;   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;    _id: ...,&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;    name: &apos;Sue&apos;,&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;    pets: [&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;        name: &apos;Fido&apos;,&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;        animalType: &apos;dog&apos;,&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;        toys: [&apos;squeakyToy&apos;, &apos;bone&apos;]&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;   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;&amp;nbsp;&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;// Upgrade dog bones&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;db.PetOwner.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;  &apos;pets.animalType&apos;: &apos;dog&apos;,&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;  &apos;pets.toys&apos;: &apos;bone&apos;&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;  $set: { &apos;pets.$.toys.$&apos;: &apos;meatBone&apos; }&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;&amp;nbsp;&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;// Annotate pets with certain toys&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;db.PetOwner.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;  &apos;pets.toys&apos;: { $in: [&apos;mouse&apos;, &apos;squeakyToy&apos;] }&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;  $set: { &apos;pets.$&apos;: { happy: true } } // ...same as { &apos;pets.$.happy&apos;: true } ???&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;</comment>
                            <comment id="403243" author="alerner" created="Wed, 14 Aug 2013 20:58:26 +0000"  >&lt;p&gt;@Daniel, we&apos;ll continue matching from root. That&apos;s not the issue. The issue is that for some queries (that don&apos;t traverse arrays, or traverse them in alternative ways, as in a $or) there is not a clear answer of what semantics to use.&lt;/p&gt;

&lt;p&gt;@Joe, There&apos;s one earlier in this thread.&lt;/p&gt;</comment>
                            <comment id="402943" author="reptilicus" created="Wed, 14 Aug 2013 15:47:04 +0000"  >&lt;p&gt;What are the proposed constructs / syntaxes for doing a nested update? &lt;/p&gt;</comment>
                            <comment id="402896" author="dblock" created="Wed, 14 Aug 2013 15:12:00 +0000"  >&lt;p&gt;I think there should be a clear understanding of what you&apos;re matching. Today it&apos;s very clearly the top level document. But if there was a  way to clearly match an embedded document or a result set of top level or embedded documents at any one level, the whole $ mess could just go away.&lt;/p&gt;

&lt;p&gt;I think what I am trying to say is that $set takes currently a top level path, but it could become something relative to the matched document.&lt;/p&gt;

&lt;p&gt;db.coll.find(whatever, $set : &lt;/p&gt;
{ &apos;@.x&apos; =&amp;gt; &apos;y&apos; }
&lt;p&gt;) where @ is the matched document(s).&lt;/p&gt;</comment>
                            <comment id="402881" author="alerner" created="Wed, 14 Aug 2013 15:03:30 +0000"  >&lt;p&gt;For a query whose expression is the same as the $-nested expression, that works.&lt;/p&gt;

&lt;p&gt;What would you expect to happen if the query was, say, a complex $or?&lt;/p&gt;</comment>
                            <comment id="402776" author="dblock" created="Wed, 14 Aug 2013 12:43:46 +0000"  >&lt;p&gt;Alberto, here&apos;s a blog post that&apos;s relevant for what you&apos;re asking: &lt;a href=&quot;http://artsy.github.io/blog/2013/02/09/data-corruption-and-concurrent-updates-to-embedded-objects-with-mongoid/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://artsy.github.io/blog/2013/02/09/data-corruption-and-concurrent-updates-to-embedded-objects-with-mongoid/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Syntax-wise 99% of my scenarios find a document, then match it, deep down the hierarchy. So the current syntax of multiple positional operators is very difficult to work with - you have to remember all positions of parents. I think you need something that can match one or more EMBEDDED documents, then update those, NOT update starting from the parent.&lt;/p&gt;
</comment>
                            <comment id="402557" author="reptilicus" created="Wed, 14 Aug 2013 03:51:49 +0000"  >&lt;p&gt;Hey Alberto, thats awesome news. I posted a question on S.O. that explains my particular situation: &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/18173482/mongodb-update-deeply-nested-subdocument&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://stackoverflow.com/questions/18173482/mongodb-update-deeply-nested-subdocument&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If I have a schema such as this: &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;{id: 1, &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; forecasts: [ { &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;             forecast_id: 123, &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;             name: &quot;Forecast 1&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;             levels: [ &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;                { level: &quot;proven&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;                  configs: [&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;                              config: &quot;Custom 1&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;                              variables: [{ x: 1, y:2, z:3}]&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;                              config: &quot;Custom 2&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;                              variables: [{ x: 10, y:20, z:30}]&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;   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;                { level: &quot;likely&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;                  configs: [&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;                              config: &quot;Custom 1&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;                              variables: [{ x: 1, y:2, z:3}]&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;                              config: &quot;Custom 2&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;                              variables: [{ x: 10, y:20, z:30}]&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;   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;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&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 am trying to update a particular config like this: &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.myCollection.update({&quot;id&quot;: 1, &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;                        &quot;forecasts.forecast-id&quot;: 123, &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;                        &quot;forecasts.levels.level&quot;: &quot;proven&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;                        &quot;forecasts.levels.configs.config&quot;: &quot;Custom 1&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;                         {&quot;$set&quot;: {&quot;forecasts.$.levels.$.configs.$&quot;: newData}}&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;What is the time frame for this getting into the latest incantation of mongo? &lt;/p&gt;
</comment>
                            <comment id="402461" author="alerner" created="Wed, 14 Aug 2013 00:53:00 +0000"  >&lt;p&gt;Joe, Ezekiel, &lt;/p&gt;

&lt;p&gt;We&apos;ve just &quot;swapped&quot; the new update framework that this feature depends on today.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/commit/dda99507af1eef8368d5d26a226d4d94f50d5a30&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/dda99507af1eef8368d5d26a226d4d94f50d5a30&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In practice, this means that we have much better leeway now to improve how updates work. And this ticket is on the top of our list of improvements.&lt;/p&gt;

&lt;p&gt;We&apos;ve been considering a few alternatives for how to express such updates, from the language perspective. Might you want to add your uses cases to this ticket? Finding a simple, unambiguous language construct to express how to match nested arrays is harder than one may think. So if we have more use cases example that are important, that would help. &lt;/p&gt;</comment>
                            <comment id="400491" author="reptilicus" created="Sun, 11 Aug 2013 16:56:47 +0000"  >&lt;p&gt;Honestly, it is shameful that this feature has not been implemented yet. 10000 votes from me, I&apos;m sure everyone is in favor of this. &lt;/p&gt;</comment>
                            <comment id="355163" author="evictor" created="Fri, 7 Jun 2013 08:40:42 +0000"  >&lt;p&gt;This is a huge issue. Even simple structures with minimal nesting are not feasible for production use because non-atomic find + update by array index is unreliable. +100 votes from me. &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/wink.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; My schema looks like classical normalized DB almost because of this limitation....&lt;/p&gt;</comment>
                            <comment id="338802" author="abdelouahab84" created="Sat, 18 May 2013 15:47:18 +0000"  >&lt;p&gt;+1, because i thought it was my problem:&lt;br/&gt;
It seems that i can go further than one subdocument if i want to add it dynamicaly, here is the code:&lt;br/&gt;
db.users.update(&lt;/p&gt;
{&quot;pup.cmn.id&quot;:id}
&lt;p&gt;, {&quot;$addToSet&quot;:{&quot;pup.cmn&quot;:&lt;/p&gt;
{&quot;abus&quot;:email}
&lt;p&gt;}}) &lt;br/&gt;
this give error:&lt;br/&gt;
OperationFailure: can&apos;t append to array using string field name: cmn &lt;br/&gt;
then, if i add positional element i get this:&lt;br/&gt;
db.users.update(&lt;/p&gt;
{&quot;pup.cmn.id&quot;:id}
&lt;p&gt;, {&quot;$addToSet&quot;:{&quot;pup.$.cmn&quot;:&lt;/p&gt;
{&quot;abus&quot;:email}
&lt;p&gt;}})&lt;br/&gt;
&quot;cmn&quot; : &lt;br/&gt;
[ &lt;/p&gt;
{ &quot;fto&quot; : ObjectId(&quot;5190e8a53a5f3a0c102af045&quot;) &quot;id&quot; : &quot;14.05.2013 12:29:53&quot; }
&lt;p&gt;,&lt;/p&gt;
{ &quot;abus&quot; : &quot;u...@example.com&quot; }
&lt;p&gt;]&lt;br/&gt;
so as you can see, it will add it in the same level, and i dont want that, because the application will get errors.&lt;/p&gt;</comment>
                            <comment id="325975" author="alerner" created="Wed, 1 May 2013 19:34:38 +0000"  >&lt;p&gt;Barry,&lt;/p&gt;

&lt;p&gt;Noted. We are working on the supporting machinery necessary for this feature quite actively. &lt;/p&gt;

&lt;p&gt;Alberto.&lt;/p&gt;</comment>
                            <comment id="325544" author="barrydobson" created="Wed, 1 May 2013 09:43:02 +0000"  >&lt;p&gt;I know this request is 3 years old, but without this feature it&apos;s a show stopper&lt;/p&gt;</comment>
                            <comment id="310177" author="dan@10gen.com" created="Wed, 10 Apr 2013 12:35:12 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=gkorland&quot; class=&quot;user-hover&quot; rel=&quot;gkorland&quot;&gt;gkorland&lt;/a&gt;, that means it is a candidate feature for the 2.5 series.  If the fixVersions is set to 2.5.0, 2.5.1, etc., it is slotted for a development release.&lt;/p&gt;</comment>
                            <comment id="310010" author="gkorland" created="Wed, 10 Apr 2013 06:32:46 +0000"  >&lt;p&gt;Does the fact that the issue marked as &quot;Fix Version/s:2.5.w&quot; means it is already included in next 2.5 release?&lt;/p&gt;</comment>
                            <comment id="303774" author="yades" created="Tue, 2 Apr 2013 01:46:50 +0000"  >&lt;p&gt;BTW, can we define a way to return some data after some operation like push. &lt;/p&gt;

&lt;p&gt;db.user.update(&lt;br/&gt;
	&lt;/p&gt;
{&quot;_id&quot; : ObjectId(&quot;4fa43f4d1cf26a6a8952adf1&quot;)}
&lt;p&gt;,&lt;br/&gt;
	{$push:[{&lt;br/&gt;
		&quot;booksToRead.${_id:1}.referrer : {{&lt;br/&gt;
				name : &quot;Sam&quot;&lt;br/&gt;
				type : &quot;close friend&quot;&lt;br/&gt;
			},&lt;/p&gt;
{
				$return : id
		}
&lt;p&gt;]&lt;br/&gt;
	}&lt;br/&gt;
)&lt;/p&gt;

&lt;p&gt;which gonna return a data like this:&lt;/p&gt;

{&quot;_id&quot; : ObjectId(&quot;4fa43f4d1cf26a6a8952adf1&quot;)}
&lt;p&gt;,&lt;br/&gt;
{booksToRead:[{&lt;br/&gt;
	&quot;booksToRead.${_id:1}.referrer : {{&lt;br/&gt;
			name : &quot;Sam&quot;&lt;br/&gt;
			type : &quot;close friend&quot;&lt;br/&gt;
		},&lt;/p&gt;
{
			$return : id
	}
&lt;p&gt;]&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
    &quot;booksToRead&quot;: [&lt;br/&gt;
	{&lt;br/&gt;
	    &quot;referrer&quot; : [&lt;br/&gt;
		&lt;/p&gt;
{
			&quot;id&quot;: 5,
			name :&quot;Tony&quot;,
			type : &quot;general friend&quot;
		}
&lt;p&gt;]&lt;/p&gt;
</comment>
                            <comment id="303402" author="yades" created="Mon, 1 Apr 2013 17:26:42 +0000"  >&lt;p&gt;I strongly agree with Keith Branton and really like the way he suggested.&lt;/p&gt;

&lt;p&gt;Like if a user has a book list which has 10 books to read, and now we want to change the priority, I have to do 10 times update with the position operator, it&apos;s awful especially when the list is in a multilevel subdocument.&lt;/p&gt;

&lt;p&gt;data:&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
    &quot;_id&quot;: ObjectId(&quot;4fa43f4d1cf26a6a8952adf1&quot;),&lt;br/&gt;
    &quot;userId&quot;: 1,&lt;br/&gt;
    &quot;facebookId&quot;: 1234,&lt;br/&gt;
    &quot;booksToRead&quot;: [&lt;br/&gt;
	{&lt;br/&gt;
	    &quot;_id&quot;: 1,&lt;br/&gt;
	    &quot;name&quot;: &quot;The Theory of Relativity&quot;,&lt;br/&gt;
	    &quot;Order&quot; : 0,&lt;br/&gt;
	    &quot;referrer&quot; : [&lt;br/&gt;
		&lt;/p&gt;
{
			&quot;userId&quot;: 2,
			name :&quot;Tony&quot;,
			type : &quot;general friend&quot;
		}
&lt;p&gt;,&lt;/p&gt;
{
			&quot;userId&quot;: 3,
			name : &quot;Jimmy&quot;
			type : &quot;general friend&quot;
		}
&lt;p&gt;,&lt;/p&gt;
{
			&quot;userId&quot;: 4,
			name : &quot;John&quot;
			type : &quot;close friend&quot;
		}
&lt;p&gt;]&lt;br/&gt;
        },&lt;/p&gt;
{
	    &quot;_id&quot;: 2,
	    &quot;name&quot;: Bibel&quot;,
	    &quot;Order&quot; : 1,
	    &quot;referrer&quot; : [&quot;Alex&quot;,&quot;Sam&quot;,&quot;Luke&quot;]
        }
&lt;p&gt;,&lt;/p&gt;
{
	    &quot;_id&quot;: 3,
	    &quot;name&quot;:  &quot;Pi and Richard Parker&quot;,
	    &quot;Order&quot; : 2,
	    &quot;referrer&quot; : [&quot;An Li&quot;,&quot;Bill&quot;,&quot;Steve&quot;]
        }
&lt;p&gt;]&lt;br/&gt;
    }]&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;It will be greate if we can locate each operation like $set, $push, $pull, &lt;br/&gt;
I really like Keith Branton&apos;s way, but I also suggest some change, just like:&lt;/p&gt;

&lt;p&gt;db.user.update(&lt;br/&gt;
	&lt;/p&gt;
{&quot;_id&quot; : ObjectId(&quot;4fa43f4d1cf26a6a8952adf1&quot;), &quot;facebookId&quot;: 1234}
&lt;p&gt;,&lt;br/&gt;
	{$set:&lt;br/&gt;
		[{&lt;br/&gt;
			&quot;booksToRead.${_id:1}.Order&quot; : 1&lt;br/&gt;
		},{&lt;br/&gt;
			&quot;booksToRead.${name:&quot;\&quot;Pi\&quot; and Richard Parker&quot;}.Order&quot; : 2, multi: true&lt;br/&gt;
		},{&lt;br/&gt;
			&quot;booksToRead.${referrer:&quot;Bill&quot;}.Order&quot; : 0, multi: true&lt;br/&gt;
		}]&lt;br/&gt;
	}&lt;br/&gt;
)&lt;/p&gt;

&lt;p&gt;Also, it&apos;s easy to modify array in deeplevel subdocument. &lt;/p&gt;

&lt;p&gt;db.user.update(&lt;br/&gt;
	&lt;/p&gt;
{&quot;_id&quot; : ObjectId(&quot;4fa43f4d1cf26a6a8952adf1&quot;)}
&lt;p&gt;,&lt;br/&gt;
	{$set:[{&lt;br/&gt;
		&quot;booksToRead.${_id:1}.referrer.${\&quot;userId\&quot;: 3}.type : &quot;general friend&quot;&lt;br/&gt;
		}]&lt;br/&gt;
	}&lt;br/&gt;
)&lt;/p&gt;</comment>
                            <comment id="242759" author="jmchambers" created="Thu, 17 Jan 2013 18:32:20 +0000"  >&lt;p&gt;Thanks for the quick feedback Alberto. Good to hear you&apos;re making progress. Keeping my fingers crossed for 2.6...&lt;/p&gt;</comment>
                            <comment id="242742" author="alerner" created="Thu, 17 Jan 2013 18:20:45 +0000"  >&lt;p&gt;This is a feature we&apos;re certainly going to be tackling. Right now, there is a large reorganization effort involving the code that this feature sits atop. The effort is in an advanced stage, even if the resulting code only started to make it to the code base. Giving a precise time now is risky, but we&apos;re optimistic that most, if not all, what&apos;s necessary would be in place in the development cycle starting after 2.4 will be released (so, potentially in the 2.6 product).&lt;/p&gt;</comment>
                            <comment id="242711" author="jmchambers" created="Thu, 17 Jan 2013 17:37:56 +0000"  >&lt;p&gt;This issue will be 3 years old this March, despite there being considerable demand for this feature. Could someone from 10gen at least comment on WHY it keeps getting postponed.&lt;/p&gt;</comment>
                            <comment id="186415" author="dblock" created="Mon, 12 Nov 2012 12:58:38 +0000"  >&lt;p&gt;Wanted to pitch in. You hear rumors of MongoDB trashing data, which are, of course, untrue. I think this is the cause of a large % of those, because it&apos;s trashing data and most developers probably don&apos;t know it.&lt;/p&gt;

&lt;p&gt;Here&apos;s an example with mongoid.&lt;/p&gt;

&lt;p&gt;&amp;#8212;&lt;br/&gt;
require &quot;spec_helper&quot;&lt;/p&gt;

&lt;p&gt;class Sandwich&lt;br/&gt;
  include Mongoid::Document&lt;br/&gt;
  embeds_many :slices&lt;br/&gt;
end&lt;/p&gt;

&lt;p&gt;class Slice&lt;br/&gt;
  include Mongoid::Document&lt;br/&gt;
  field :thickness&lt;br/&gt;
  embedded_in :sandwich&lt;br/&gt;
end&lt;/p&gt;

&lt;p&gt;describe &quot;Concurrent updates&quot; do&lt;/p&gt;

&lt;p&gt;  it &quot;work&quot; do&lt;br/&gt;
    sandwich = Sandwich.create!&lt;br/&gt;
    slice1 = Slice.create!(&lt;/p&gt;
{ sandwich: sandwich, thickness: 1 }
&lt;p&gt;)&lt;br/&gt;
    slice2 = Slice.create!(&lt;/p&gt;
{ sandwich: sandwich, thickness: 2 }
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;    sandwich.slices.count.should == 2&lt;br/&gt;
    sandwich.slices.first.thickness.should == 1&lt;br/&gt;
    sandwich.slices.last.thickness.should == 2&lt;/p&gt;

&lt;p&gt;    Mongoid.default_session&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;sandwiches&amp;quot;&amp;#93;&lt;/span&gt;.where(&lt;/p&gt;
{ _id: sandwich.id }
&lt;p&gt;).update({&lt;br/&gt;
      &quot;$pull&quot; =&amp;gt; { &quot;slices&quot; =&amp;gt; { _id: slice1.id }}&lt;br/&gt;
    })&lt;br/&gt;
    Mongoid.default_session&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;sandwiches&amp;quot;&amp;#93;&lt;/span&gt;.find.first.should == {&lt;br/&gt;
      &quot;_id&quot; =&amp;gt; sandwich.id,&lt;br/&gt;
      &quot;slices&quot; =&amp;gt; [&lt;/p&gt;
{ &quot;_id&quot; =&amp;gt; slice2.id, &quot;thickness&quot; =&amp;gt; slice2.thickness }]&lt;br/&gt;
    }&lt;br/&gt;
&lt;br/&gt;
    # =&amp;gt; we don&apos;t expect mongoid to notice the concurrent removal&lt;br/&gt;
    sandwich.slices.count.should == 2&lt;br/&gt;
&lt;br/&gt;
    slice2.update_attributes!({ thickness: 3 })&lt;br/&gt;
&lt;br/&gt;
    # =&amp;gt; we do expect mongoid to update the correct record&lt;br/&gt;
    Mongoid.default_session&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;sandwiches&amp;quot;&amp;#93;&lt;/span&gt;.find.first.should == {&lt;br/&gt;
      &quot;_id&quot; =&amp;gt; sandwich.id,&lt;br/&gt;
      &quot;slices&quot; =&amp;gt; [{ &quot;_id&quot; =&amp;gt; slice2.id, &quot;thickness&quot; =&amp;gt; slice2.thickness }
&lt;p&gt;]&lt;br/&gt;
    }&lt;/p&gt;

&lt;p&gt;  end&lt;/p&gt;

&lt;p&gt;end&lt;br/&gt;
&amp;#8212;&lt;/p&gt;

&lt;p&gt;What does this do?&lt;/p&gt;

&lt;p&gt;&amp;#8212;&lt;br/&gt;
1) Concurrent updates works&lt;br/&gt;
     Failure/Error: }&lt;br/&gt;
       expected: {&quot;_id&quot;=&amp;gt;&quot;509fd8d13b5552dde5000001&quot;, &quot;slices&quot;=&amp;gt;[&lt;/p&gt;
{&quot;_id&quot;=&amp;gt;&quot;509fd8d13b5552dde5000003&quot;, &quot;thickness&quot;=&amp;gt;3}]}&lt;br/&gt;
            got: {&quot;_id&quot;=&amp;gt;&quot;509fd8d13b5552dde5000001&quot;, &quot;slices&quot;=&amp;gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;{&quot;_id&quot;=&amp;gt;&quot;509fd8d13b5552dde5000003&quot;, &quot;thickness&quot;=&amp;gt;2}, {&quot;thickness&quot;=&amp;gt;3}&amp;#93;&lt;/span&gt;} (using ==)&lt;br/&gt;
       Diff:&lt;br/&gt;
       @@ -1,3 +1,3 @@&lt;br/&gt;
        &quot;_id&quot; =&amp;gt; &quot;509fd8d13b5552dde5000001&quot;,&lt;br/&gt;
       -&quot;slices&quot; =&amp;gt; [{&quot;_id&quot;=&amp;gt;&quot;509fd8d13b5552dde5000003&quot;, &quot;thickness&quot;=&amp;gt;3}
&lt;p&gt;]&lt;br/&gt;
       +&quot;slices&quot; =&amp;gt; [&lt;/p&gt;
{&quot;_id&quot;=&amp;gt;&quot;509fd8d13b5552dde5000003&quot;, &quot;thickness&quot;=&amp;gt;2}
&lt;p&gt;, &lt;/p&gt;
{&quot;thickness&quot;=&amp;gt;3}
&lt;p&gt;]&lt;br/&gt;
&amp;#8212;&lt;/p&gt;

&lt;p&gt;Ouch. This case can be solved at 1-level deep, with a lot of work for the ODM developer. But not nested, which is very frequent because of this bug. So MongoDB has different consistency guarantees for top-level documents, 1-level embedded documents and N-level embedded documents. It&apos;s bad.&lt;/p&gt;

&lt;p&gt;More details at &lt;a href=&quot;https://github.com/mongoid/mongoid/issues/2545&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongoid/mongoid/issues/2545&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="173382" author="a_niceguy57" created="Wed, 10 Oct 2012 16:26:17 +0000"  >
&lt;p&gt;There is a bigger issue going on here than just adding support for multiple positional operators. I believe this ticket and other tickets exist for the most part due to a major lack of index support elsewhere.&lt;/p&gt;

&lt;p&gt;Please see and VOTE for  &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-7313&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-7313&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Durran (original author of the ticket) appears to be like many of the users forced to setup his document using flat regular arrays to gain index performance. In his document, he could easily switch his flat medications/prescriptions arrays to associative arrays by using &quot;id&quot; field as the key and use the following command instead...&lt;/p&gt;

&lt;p&gt;collection.update(&lt;/p&gt;
{...}
&lt;p&gt;, {$set:&lt;/p&gt;
{&quot;medications.23.prescriptions.77.quantity&quot;:30}
&lt;p&gt; }, false, true);&lt;/p&gt;


&lt;p&gt;Now the reason why he did not do that (just like many other users) is that it is not possible to index at nested levels if the data is setup as associative arrays instead of regular arrays.&lt;/p&gt;

&lt;p&gt;I have run into the same users as Steve B has on the internet. I am actually one of those users who was forced to rework my schema in some cases while in other cases resort to a second synced flat structure for query purposes. I believe we should stop asking users to rework their schema and use the gawky positional operator. The better and more elegant solution is to add index support at the associative nested array levels and let users keep their object-oriented schema.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-7313&quot; title=&quot;Add Nested Data (Associative Array) and Index Support&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-7313&quot;&gt;&lt;del&gt;SERVER-7313&lt;/del&gt;&lt;/a&gt; ticket has a link to a nice article about arrays and atomic issues. The article proposes associative arrays to workaround the atomic issues but unfortunately it still does not address the lack of index support.&lt;/p&gt;</comment>
                            <comment id="169006" author="michaelfitchett" created="Thu, 27 Sep 2012 22:44:55 +0000"  >&lt;p&gt;This ticket was created in 2010, it&apos;s almost 2013. I don&apos;t see this happening. It&apos;s obvious that people have a need for this functionalty. The reason it probably has not been implemented is do to some limitation with how MongoDB was originally built. For instance it&apos;s possible that a single document could become greater than the default 16MB file split which may cause an issue when trying to search multiple levels deep.&lt;/p&gt;

&lt;p&gt;I decides a long time ago to just seperate out the data into multiple collections. MongoDB for my use has proven to be a better alternative to structured tables. Even without this functionalty. I just program around it for now.&lt;/p&gt;

&lt;p&gt;I would however like to see this get added.&lt;/p&gt;</comment>
                            <comment id="168688" author="k00k" created="Thu, 27 Sep 2012 13:32:28 +0000"  >&lt;p&gt;+1 When people run into this issue (StackOverflow, Google Groups), I keep hearing people suggest that one reworks his schema to flatten it out or add another collection. To me, this goes against the core of what MongoDB and NoSQL data structures are all about! Otherwise, I might as well go back to SQL with 20 tables and a ton of JOINS. This is CORE functionality, please get it in there soon!&lt;/p&gt;</comment>
                            <comment id="163909" author="slopez" created="Thu, 13 Sep 2012 13:24:43 +0000"  >&lt;p&gt;+1 for this issue being addressed. Running into a use case where I need to update atomically a document in this fashion.&lt;/p&gt;</comment>
                            <comment id="149994" author="john.nishinaga@patdeegan.com" created="Thu, 2 Aug 2012 19:15:45 +0000"  >&lt;p&gt;+1 for this. This is a big deal if you&apos;re going to use MongoDB.&lt;/p&gt;</comment>
                            <comment id="134884" author="tystr" created="Wed, 20 Jun 2012 17:42:48 +0000"  >&lt;p&gt;+1 for this, I also ran into this exact issue--needing to use the positional op to access nested arrays. I&apos;m glad to see it&apos;s been scheduled for 2.3 &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="112426" author="mattbodman" created="Mon, 23 Apr 2012 02:24:41 +0000"  >&lt;p&gt;I also appeal to the most awesome mongodevs to implement this feature.  Embedding is sure one of the coolest features on offer, but without a way to efficiently handle updates of deeply embedded documents, its perhaps more painful than its worth (at this stage).  Keep up the great work!&lt;/p&gt;</comment>
                            <comment id="106239" author="thesilentman" created="Tue, 3 Apr 2012 21:08:30 +0000"  >&lt;p&gt;Hi, there dear mongodevs!!! Any news on this issue?&lt;/p&gt;</comment>
                            <comment id="105466" author="ciupenhauer" created="Sat, 31 Mar 2012 18:19:22 +0000"  >&lt;p&gt;I find the presence of the word &apos;desired&apos; next to 2.1 a bit discouraging. This feature is an absolute must, and it has already been dragging beyond belief. &lt;/p&gt;</comment>
                            <comment id="98561" author="invite" created="Wed, 14 Mar 2012 02:31:14 +0000"  >&lt;p&gt;I also need this feature&lt;/p&gt;</comment>
                            <comment id="97354" author="bryan" created="Fri, 9 Mar 2012 21:01:23 +0000"  >&lt;p&gt;Add me to the list of people who really need this feature, and with an estimate of less than a week, why not just get it done? &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="87944" author="geddesign" created="Mon, 13 Feb 2012 18:21:38 +0000"  >&lt;p&gt;Is this still planned for 2.1? Need this feature badly.&lt;/p&gt;</comment>
                            <comment id="78374" author="neil.bartlett" created="Sun, 8 Jan 2012 00:54:50 +0000"  >&lt;p&gt;Major +1. New user but hit this very early on. First major headache with Mongo though. Apart for this it has performed very well on my db which currently has approx 250k records in it.&lt;/p&gt;</comment>
                            <comment id="76469" author="bonozo" created="Thu, 29 Dec 2011 04:51:14 +0000"  >&lt;p&gt;I am new to mongoDB and ran into this issue very early on.  I naturally assumed I did not know how to write the update query.  Imagine my surprise when I was informed, &lt;a href=&quot;https://groups.google.com/forum/#!topic/mongodb-user/k-H-N-767r0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;in the forums&lt;/a&gt;, it is an actual limitation of mongoDB!  +1&lt;/p&gt;</comment>
                            <comment id="54895" author="rawsoft" created="Fri, 16 Sep 2011 23:55:40 +0000"  >&lt;p&gt;Definitely a huge &lt;ins&gt;1 for me as well, I&apos;m just updating the full document now and I have a todo assign to about 20&lt;/ins&gt; classes that need it. Anxiously waiting for 2.1!&lt;/p&gt;</comment>
                            <comment id="46215" author="marbemac" created="Wed, 3 Aug 2011 22:04:07 +0000"  >&lt;p&gt;Huge +1 from me as well. My example case is a state-&amp;gt;city-&amp;gt;school nested structure and I would like to be able to update the school data with an update.&lt;/p&gt;</comment>
                            <comment id="39373" author="geddesign" created="Mon, 27 Jun 2011 17:29:08 +0000"  >&lt;p&gt;This is a show stopper. Mongo really needs this feature. Any update?&lt;/p&gt;</comment>
                            <comment id="33630" author="remonvv" created="Fri, 20 May 2011 08:51:05 +0000"  >&lt;p&gt;I hope this won&apos;t be bumped to 2.1+ given the fact that it basically means we cannot atomically update any field in any given document which should be possible. That said this shouldn&apos;t be rush implemented by simply adding allowing multiple ordered positional operators. I agree with Keith&apos;s sentiments that the positional operator is pretty limited/clumsy. In an update call the &quot;criteria&quot; parameter should only be responsible for selecting the document(s) the update has to be applied on. Deciding on which element of which (nested) array should be updated really belongs in the &quot;update&quot; parameter as Keith suggests.&lt;/p&gt;
</comment>
                            <comment id="33531" author="thesilentman" created="Thu, 19 May 2011 16:40:17 +0000"  >&lt;p&gt;So, that leaves the question, when do you plan to release 2.1? &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/biggrin.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; (Just joking, but this would really be a big help in my current development. Too bad it&apos;s not supported yet.)&lt;/p&gt;</comment>
                            <comment id="33432" author="eliot" created="Thu, 19 May 2011 03:29:27 +0000"  >&lt;p&gt;1.9 planning is things that might make it into 1.9&lt;br/&gt;
If not, they&apos;ll be on the short list for 2.1&lt;/p&gt;</comment>
                            <comment id="33406" author="thesilentman" created="Thu, 19 May 2011 00:39:53 +0000"  >&lt;p&gt;I am stuck on the same issue. Has this fallen off the radar? I can&apos;t see it anywhere for version 1.9.1 or 1.9.2.&lt;br/&gt;
Thank you&lt;/p&gt;</comment>
                            <comment id="32137" author="rock217" created="Wed, 11 May 2011 19:59:43 +0000"  >&lt;p&gt;hope this one didn&apos;t fall off the radar&lt;/p&gt;</comment>
                            <comment id="29104" author="musa" created="Fri, 15 Apr 2011 21:30:16 +0000"  >&lt;p&gt;We really need this to be implemented in MongoDB sooner than later. This seems natural to be part of MongoDB.&lt;/p&gt;

&lt;p&gt;Without this we just can&apos;t implement voting functionality in our comments system.&lt;/p&gt;

&lt;p&gt;So we are disabling our rating functionality and wait for 831 to be included in v1.9&lt;/p&gt;

&lt;p&gt;This is a BIIIIIIIIIIIIIG up vote for this jira.&lt;/p&gt;

&lt;p&gt;Thanks&lt;br/&gt;
Musa&lt;/p&gt;</comment>
                            <comment id="25383" author="wangdebing" created="Mon, 7 Mar 2011 09:22:36 +0000"  >&lt;p&gt;i really need to update nested array field ... ! &lt;/p&gt;</comment>
                            <comment id="23115" author="durran" created="Fri, 4 Feb 2011 16:32:19 +0000"  >&lt;p&gt;I like that idea since it&apos;s a bit more flexible in that multiple atomic updates could happen at different points in the hierarchy in a single call, instead of having to do multiples... The proposed syntax feels a little odd though to me.&lt;/p&gt;</comment>
                            <comment id="23113" author="keithbranton" created="Fri, 4 Feb 2011 16:25:26 +0000"  >&lt;p&gt;While we clearly need a way to manipulate deeply nested objects atomically, the positional operator is very limited because it depends on the query providing its context - and can only be used once in an update. Not being aware of this jira I started another (&lt;a href=&quot;http://jira.mongodb.org/browse/SERVER-2476&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;http://jira.mongodb.org/browse/SERVER-2476&lt;/a&gt;), and now have a suggestion that could fix both problems.&lt;/p&gt;

&lt;p&gt;If an array could be used for the field name in an update modifier, and bson queries were processed and iterated when encountered in the array, then we could use:&lt;/p&gt;

&lt;p&gt;    .update(&lt;/p&gt;
{ &quot;_id&quot;:1}
&lt;p&gt;, {$set:{&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;medications&amp;quot;,{_id:23},&amp;quot;prescriptions&amp;quot;,{_id:77},&amp;quot;quantity&amp;quot;&amp;#93;&lt;/span&gt;:30}) &lt;/p&gt;

&lt;p&gt;instead of the proposed &lt;/p&gt;

&lt;p&gt;    .update(&lt;/p&gt;
{ &quot;_id&quot;:1, &quot;medications._id&quot;:23, &quot;medications.prescriptions._id&quot;:77 }
&lt;p&gt;, &lt;br/&gt;
                   {$set:{medications.$0.prescriptions.$1.quantity&quot; : 30 }}) &lt;/p&gt;

&lt;p&gt;and we could even do (using the gist examples)&lt;/p&gt;

&lt;p&gt;    .update(&lt;/p&gt;
{ &quot;_id&quot;:1}
&lt;p&gt;, {$set:{&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;medications&amp;quot;,{_id:23},&amp;quot;prescriptions&amp;quot;,{_id:77},&amp;quot;quantity&amp;quot;&amp;#93;&lt;/span&gt;:30, &lt;br/&gt;
                                                &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;medications&amp;quot;,{_id:23},&amp;quot;prescriptions&amp;quot;,{_id:13},&amp;quot;quantity&amp;quot;&amp;#93;&lt;/span&gt;:6},&lt;br/&gt;
                                     $push:{&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;medications&amp;quot;,{_id:41},&amp;quot;prescriptions&amp;quot;&amp;#93;&lt;/span&gt;,{_id:24,quantity:4,started:2009-03-01}}}) &lt;/p&gt;

&lt;p&gt;in a single operation, in addition to &lt;/p&gt;

&lt;p&gt;    .update(&lt;/p&gt;
{ &quot;_id&quot;:1}
&lt;p&gt;, {$set:{&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;medications&amp;quot;,{_id:23},&amp;quot;prescriptions&amp;quot;,{},&amp;quot;quantity&amp;quot;&amp;#93;&lt;/span&gt;:0}}) &lt;/p&gt;

&lt;p&gt;which would set quantity to 0 for all prescriptions for medication 23 and &lt;/p&gt;

&lt;p&gt;    .update(&lt;/p&gt;
{ &quot;_id&quot;:1}
&lt;p&gt;, {$set:{&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;medications&amp;quot;,{_id:{$lte:7},&amp;quot;prescriptions&amp;quot;,{_id:{$gt:60}},&amp;quot;quantity&amp;quot;&amp;#93;&lt;/span&gt;:0}}) &lt;/p&gt;

&lt;p&gt;which would set quantity to 0 where medication_id&amp;lt;=7 and prescription_id&amp;gt;60.&lt;/p&gt;

&lt;p&gt;It would also be really useful if this approach could be used in queries too. Imagine being able to do this&lt;/p&gt;

&lt;p&gt;    .find({&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;medications&amp;quot;,{_id:23},&amp;quot;prescriptions&amp;quot;,{},&amp;quot;quantity&amp;quot;&amp;#93;&lt;/span&gt;:{$gt:120})&lt;/p&gt;

&lt;p&gt;to find all patients who have been prescribed more than 120 for medication 23&lt;/p&gt;

&lt;p&gt;I wonder too if the {} could be inferred - if you are using an array for a field name then all elements of arrays are automatically considered in the absence of a query&lt;/p&gt;

&lt;p&gt;Am I onto something here or just out in left field?&lt;/p&gt;</comment>
                            <comment id="22839" author="wangdebing" created="Mon, 31 Jan 2011 01:25:41 +0000"  >&lt;p&gt;i really need to update nested array field ... ! &lt;/p&gt;</comment>
                            <comment id="22438" author="zippy1981" created="Mon, 17 Jan 2011 01:53:09 +0000"  >&lt;p&gt;I just ran into this issue again. I can work around it for now since I can guarantee the position of the outer array. &lt;/p&gt;

&lt;p&gt;If had a case where I could notavoid two round trips without this feature, the ability to lock a document would be useful.&lt;/p&gt;</comment>
                            <comment id="15717" author="azeklm" created="Tue, 13 Jul 2010 13:43:16 +0000"  >&lt;p&gt;i really need to update nested array field ... !&lt;/p&gt;</comment>
                            <comment id="13607" author="eliot" created="Tue, 13 Apr 2010 15:39:18 +0000"  >&lt;p&gt;certainly can do it without the $0&lt;/p&gt;</comment>
                            <comment id="13338" author="durran" created="Wed, 31 Mar 2010 16:05:31 +0000"  >&lt;p&gt;Well if it&apos;s smart enough not to need them and just use $ that&apos;s even nicer.&lt;/p&gt;</comment>
                            <comment id="13267" author="coenhyde" created="Tue, 30 Mar 2010 02:27:11 +0000"  >&lt;p&gt;I would like this feature. However is there a reason why we need the array sequence id? Why not just have &apos;medications.$.prescriptions.$.quantity&apos; instead of &apos;medications.$0.prescriptions.$1.quantity&apos;?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="332607">SERVER-27089</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="43910">SERVER-6399</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="11615">SERVER-828</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="17008">SERVER-3089</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="75813">SERVER-9726</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="142483">SERVER-14281</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="98412">SERVER-11696</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="140361">SERVER-14164</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="136305">SERVER-13929</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="48158">SERVER-6864</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="163155" name="Design Array updates.pdf" size="301311" author="tess.avitabile@mongodb.com" created="Fri, 11 Aug 2017 20:58:44 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>149.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 30 Mar 2010 02:27:11 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 20 weeks, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-6399'>SERVER-6399</a></s>, <s><a href='https://jira.mongodb.org/browse/WRITING-1347'>WRITING-1347</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-27089'>SERVER-27089</a></s>]]></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>false</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, 20 weeks, 2 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>jesse@mongodb.com</customfieldvalue>
            <customfieldvalue>abdelouahab84</customfieldvalue>
            <customfieldvalue>adambuczynski</customfieldvalue>
            <customfieldvalue>alerner</customfieldvalue>
            <customfieldvalue>pozdnyakov.asp</customfieldvalue>
            <customfieldvalue>alexreg</customfieldvalue>
            <customfieldvalue>rock217</customfieldvalue>
            <customfieldvalue>yades</customfieldvalue>
            <customfieldvalue>a.braun</customfieldvalue>
            <customfieldvalue>andrew.kalek@anlek.com</customfieldvalue>
            <customfieldvalue>azeklm</customfieldvalue>
            <customfieldvalue>akhodakivskiy</customfieldvalue>
            <customfieldvalue>ashraffayad</customfieldvalue>
            <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>barrydobson</customfieldvalue>
            <customfieldvalue>basileduplessis</customfieldvalue>
            <customfieldvalue>binard</customfieldvalue>
            <customfieldvalue>bonozo</customfieldvalue>
            <customfieldvalue>testVersion10</customfieldvalue>
            <customfieldvalue>bryan</customfieldvalue>
            <customfieldvalue>derelinguo</customfieldvalue>
            <customfieldvalue>cstigler</customfieldvalue>
            <customfieldvalue>catchamonkey</customfieldvalue>
            <customfieldvalue>coenhyde</customfieldvalue>
            <customfieldvalue>danirod</customfieldvalue>
            <customfieldvalue>ciupenhauer</customfieldvalue>
            <customfieldvalue>dblock</customfieldvalue>
            <customfieldvalue>daniel619</customfieldvalue>
            <customfieldvalue>dan@mongodb.com</customfieldvalue>
            <customfieldvalue>geddesign</customfieldvalue>
            <customfieldvalue>kingklaudi</customfieldvalue>
            <customfieldvalue>ylmbtm</customfieldvalue>
            <customfieldvalue>den43</customfieldvalue>
            <customfieldvalue>dkmooers</customfieldvalue>
            <customfieldvalue>alice@gothcandy.com</customfieldvalue>
            <customfieldvalue>durran</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>evictor</customfieldvalue>
            <customfieldvalue>thesilentman</customfieldvalue>
            <customfieldvalue>freddy.loeckli</customfieldvalue>
            <customfieldvalue>bramanga</customfieldvalue>
            <customfieldvalue>Guihgo</customfieldvalue>
            <customfieldvalue>secr3t0</customfieldvalue>
            <customfieldvalue>gkorland</customfieldvalue>
            <customfieldvalue>hanspetee</customfieldvalue>
            <customfieldvalue>hugh.watkins@ericsson.com</customfieldvalue>
            <customfieldvalue>Featureme</customfieldvalue>
            <customfieldvalue>isole</customfieldvalue>
            <customfieldvalue>ivan.fioravanti@4ward.it</customfieldvalue>
            <customfieldvalue>jabclab</customfieldvalue>
            <customfieldvalue>jeffwhelpley</customfieldvalue>
            <customfieldvalue>reptilicus</customfieldvalue>
            <customfieldvalue>john.nishinaga@patdeegan.com</customfieldvalue>
            <customfieldvalue>jmccormick.me</customfieldvalue>
            <customfieldvalue>jmchambers</customfieldvalue>
            <customfieldvalue>jpblair</customfieldvalue>
            <customfieldvalue>jlaustill@gmail.com</customfieldvalue>
            <customfieldvalue>jochan</customfieldvalue>
            <customfieldvalue>zippy1981</customfieldvalue>
            <customfieldvalue>keithbranton</customfieldvalue>
            <customfieldvalue>ketannaik</customfieldvalue>
            <customfieldvalue>kimshen</customfieldvalue>
            <customfieldvalue>richtertk</customfieldvalue>
            <customfieldvalue>katakam.maniratnam@gmail.com</customfieldvalue>
            <customfieldvalue>manjunath.bhuyar@hp.com</customfieldvalue>
            <customfieldvalue>marbemac</customfieldvalue>
            <customfieldvalue>gurix</customfieldvalue>
            <customfieldvalue>codegourmet</customfieldvalue>
            <customfieldvalue>mattbodman</customfieldvalue>
            <customfieldvalue>meghadev</customfieldvalue>
            <customfieldvalue>michaelfitchett</customfieldvalue>
            <customfieldvalue>mjoyce91</customfieldvalue>
            <customfieldvalue>invite</customfieldvalue>
            <customfieldvalue>mikewasouski</customfieldvalue>
            <customfieldvalue>tjombka</customfieldvalue>
            <customfieldvalue>musa</customfieldvalue>
            <customfieldvalue>mhc</customfieldvalue>
            <customfieldvalue>murilolobatto</customfieldvalue>
            <customfieldvalue>neeraj.wadhwani@glu.com</customfieldvalue>
            <customfieldvalue>neil.bartlett</customfieldvalue>
            <customfieldvalue>prashaantt</customfieldvalue>
            <customfieldvalue>rainerschreiber</customfieldvalue>
            <customfieldvalue>raulgd</customfieldvalue>
            <customfieldvalue>mravindrarao</customfieldvalue>
            <customfieldvalue>remonvv</customfieldvalue>
            <customfieldvalue>wir33658</customfieldvalue>
            <customfieldvalue>rwander</customfieldvalue>
            <customfieldvalue>rawsoft</customfieldvalue>
            <customfieldvalue>slnowak</customfieldvalue>
            <customfieldvalue>samiten</customfieldvalue>
            <customfieldvalue>sam.weaver</customfieldvalue>
            <customfieldvalue>SanderDN</customfieldvalue>
            <customfieldvalue>slopez</customfieldvalue>
            <customfieldvalue>shanehou</customfieldvalue>
            <customfieldvalue>gizmonerd</customfieldvalue>
            <customfieldvalue>5yki</customfieldvalue>
            <customfieldvalue>sparshy</customfieldvalue>
            <customfieldvalue>k00k</customfieldvalue>
            <customfieldvalue>a_niceguy57</customfieldvalue>
            <customfieldvalue>tavacizade</customfieldvalue>
            <customfieldvalue>tess.avitabile@mongodb.com</customfieldvalue>
            <customfieldvalue>Vizsla</customfieldvalue>
            <customfieldvalue>tolgaevcimen</customfieldvalue>
            <customfieldvalue>awellard</customfieldvalue>
            <customfieldvalue>mercmobily</customfieldvalue>
            <customfieldvalue>tystr</customfieldvalue>
            <customfieldvalue>vijaychow7@gmail.com</customfieldvalue>
            <customfieldvalue>vdaubry</customfieldvalue>
            <customfieldvalue>wilsondjm</customfieldvalue>
            <customfieldvalue>kuentingshiu</customfieldvalue>
            <customfieldvalue>wangdebing</customfieldvalue>
            <customfieldvalue>wenchenglai</customfieldvalue>
            <customfieldvalue>Arkhee</customfieldvalue>
            <customfieldvalue>wongsolo</customfieldvalue>
            <customfieldvalue>altfatterz</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrjrvb:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3895</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_11861" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>User Summary</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11858"><![CDATA[Completed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrizif:</customfieldvalue>

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