title: Update multiple documents by array of objects field value in mongoose
body: <p>Here is my Schema.  </p>
  
  <pre><code> Home = new Schema({
          name: { type: String, required: true},
          description: {type: String},
          administrator: {type : mongoose.Schema.Types.ObjectId, ref: 'User', required: true},
  
      users: [{ 
          _id: {type : mongoose.Schema.Types.ObjectId, ref: 'User'},
          email: {type: String},
          name: { type: String},
          status: { type: Number}
      }],
      rooms: [Room]
  
  
  });
  module.exports = mongoose.model('Home', Home);
  </code></pre>
  
  <p>If I want to find a specific user across multiple documents, I could do</p>
  
  <blockquote>
    <p>Home.find({"users.email": "johnk@gmail.com"},{users:1})</p>
  </blockquote>
  
  <p>This would return all homes with users.email = johnk@gmail.com</p>
  
  <p>But the user's field is an array.</p>
  
  <pre><code>"users" : [
          {
              "status" : 0,
              "name" : "Yaknow",
              "email" : "yaknow@gmai.com",
              "_id" : ObjectId("5875a42ea469f40c684de385")
          },
          {
              "status" : 1,
              "name" : "johnk",
              "email" : "johnk@gmail.com",
              "_id" : ObjectId("586e31c6ce07af6f891f80fd")
          }
      ]
  </code></pre>
  
  <p>(this is just from one home, if there are many homes, there will be many arrays like this)
  So the above query will return each user array of each home the user has email in. 
  My question is, how do I update all instances of that JohnK into JohnKirtster? 
  Using this would update every user in the array's name to JohnKirster</p>
  
  <blockquote>
    <p>Home.update(query, {users.name: "JohnKirster"}) </p>
  </blockquote>