title: Updating array within mongodb record with mongoose
body: <p>What is the best way to update a value within an array saved in a mongodb record? Currently, I'm trying it this way:</p>
  
  <pre><code>Record.find({ 'owner': owner}, {}, {sort: { date: -1 }}, function(err, record){
      if(!err){
          for (var i = 0; i &lt; record[0].array.length; i++){
              record[0].array[i].score = 0;
  
              record[0].array[i].changed = true;
  
              record[0].save();
          }
      }
   });
  </code></pre>
  
  <p>And the schema looks like this:</p>
  
  <pre><code>var recordSchema = mongoose.Schema({
      owner: {type: String},
      date: {type: Date, default: Date.now},
      array: mongoose.Schema.Types.Mixed
  });
  </code></pre>
  
  <p>Right now, I can see that the array updates, I get no error in saving, but when I query the database again, the array hasn't been updated.</p>