title: Updating a deep record in MongoDb
body: <p>I have this record in MongoDb, and am using the native API:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
      "_children" : {
          "addressesR" : [
              {
                  "id" : ObjectId("530eea01071bd1a53065c1a6"),
                  "personId" : ObjectId("530eea01071bd1a53065c1a4"),
                  "street" : "ivermey",
                  "city" : "perth",
                  "_children" : {
                  }
              },
              {
                  "_children" : {
                      "configId" : {
                          "a" : {
                              "_children" : [
                                  {
                                      "b" : 10
                                  },
                                  {
                                      "b" : 20
                                  }
                              ]
                          }
                      }
                  },
                  "city" : "perth",
                  "configId" : ObjectId("530eea01071bd1a53065c1a3"),
                  "id" : ObjectId("530eea01071bd1a53065c1a5"),
                  "personId" : ObjectId("530eea01071bd1a53065c1a4"),
                  "street" : "bitton"
              }
          ],
      }
  }
  </code></pre>
  
  <p>I need to update, in one query, that nested 'b' to 30.
  I can find the record:</p>
  
  <pre><code>db.peopleR.find( { '_children.addressesR._children.configId.a._children.b': 20 } );
  </code></pre>
  
  <p>But I am having a hard time finding a way to update that particular value.</p>
  
  <p>I am trying:</p>
  
  <pre><code>db.peopleR.update( { '_children.addressesR._children.configId.a._children.b': 20 }, { $set: { '_children.addressesR.$._children.configId.a.$._children.b': 30 }   }  )
  </code></pre>
  
  <p>But I am getting: </p>
  
  <pre><code>Cannot apply the positional operator without a corresponding query field containing an array.
  </code></pre>
  
  <p>Now, considering that for other constraints I absolutely need to update <em>just</em> 'b', is there a way for me to do it? Or, is it impossible to use the $ operand twice? ( that is, I can only update the inner part of an object if it's only 1 level down?)</p>