title: Update array element in mongo
body: <p>I want to update an array that I have in a mongo doc. The structure of which looks something like: </p>
  
  <pre><code>{
    _id: id,
    myArray: [
      {key1: val, key2: val, key3: val}, 
      {key1: val, key2: val, key3: val}, 
      {key1: val, key2: val, key3: val}
    ]
  }
  </code></pre>
  
  <p>I need to be able to do something like the SQL equivalent of update WHERE. Namely, get this particular document in the collection by searching with id (which you can do trivially with <code>MyDoc.update({_id: id}...);</code>) and then locate the specific object in the array based on a key value pair, and then update the value of a different key in that same object.  </p>