title: Updating an array item using NodeJS, MongoDB & Monk
body: <p>I have a data set like this:</p>
  
  <pre><code>{ 
    name : 'Doc Name',
    photos: [
        {
          name: 'photo1',
          url: 'http://.....'
        },
        {
          name: 'photo2',
          url: 'http://......'
        }
     ],
     etc ...
  </code></pre>
  
  <p>Using Monk <a href="https://github.com/LearnBoost/monk" rel="noreferrer">https://github.com/LearnBoost/monk</a> how do I update photo2? I can use an index as I am iterating over the fields at the moment.</p>
  
  <p>My current attempt below gives me an error, and I can't use a variable for the JSON selector (as in the index).</p>
  
  <pre><code>collection.update({_id: data._id}, {photos[i].data: filename}, function(err, updatedata) {
  
              });
  </code></pre>