title: add property to nested array in mongodb document
body: <p>I have a mongodb document with the following structure</p>
  
  <pre><code>&gt; db.user.find().limit(1);
  { "_id" : "1", "foo" : { "bars" : [
      {
          "name" : "bar1"
      },
      {
          "name" : "bar2"
      },
  ], ... }, ... }
  </code></pre>
  
  <p>I want to add a new property to each <code>bar</code>. I've got my script iterating over the <code>bars</code> array, but I can't get the new property in there, how can I do this?</p>
  
  <pre><code>var users = db.user.find({"foo.bars":{$exists:true}});
  
  users.forEach(function(user) {
      user.foo.bars.forEach(function(bar)
      {
         printjson(bar);
         //how can I specify the current 'bar' in this update?
         //db.experience.update({_id: user._id}, {$set: {"what goes here?" : "newbarValue"}});
      });
  });
  </code></pre>