title: Update multiple documents by providing documents in body, mongoose/mongodb
body: <p>I need to update several documents by providing them in the body. I can't query them, they must  be provided.</p>
  
  <p>Example:</p>
  
  <pre><code> var persons = [
      {id: 1, name'Joe', active: false}, 
      {id:2, name:'Jane', active: false})
  ];
  </code></pre>
  
  <p>This data is provided in the body and I want to set the active property to false.</p>
  
  <pre><code>exports.setActivePropertyOnPersons = function(input,callback){
    for(var i = 0;i&lt;input.body.length;i++){
      mongoose.model('person').findOne({id:input.body[i].id}, function(err, person){
        person.active = false;
        person.save();
      })
    }
    callback.send(200)
  };
  </code></pre>
  
  <p>This code feels no good. Is there any better query to do this? I don't find any in the docs.</p>