title: update multiple elements in array mongodb
body: <p>I want to update chargeList isDelete property to true when date is greater than a specific value. my schema as follows.</p>
  
  <pre><code>{
     "chargeList": [
       { 
           "date": ISODate("2013-06-26T18:57:30.012Z"),
           "price": "123",
           "isDelete": false
  
       },
       { 
           "date": ISODate("2013-06-27T18:57:30.012Z"),
           "price": "75",
           "isDelete": false
  
       }
     ]
   }
  </code></pre>
  
  <p>schema is as follows.</p>
  
  <pre><code>var ChargeListSchema= new Schema({
      date:  { type: Date , default: Date.now  },
      price: { type: String, required: false },
      isDelete: { type: Boolean, default: false }
  });
  
  var ScheduleChargeSchema = new Schema({
  
    chargeList:[ChargeListSchema]
  
  
    });
  </code></pre>
  
  <p>I have tried as following code but it only update the matching first element in chargeList array.</p>
  
  <pre><code> Model.update(
    {
      "_id": 1,
      "chargeList": {
        "$elemMatch": {
          "date": {
             $gt:  ISODate("2013-06-26T18:57:30.012Z")
          }
        }
      }
    },
    {
      "$set": { "chargeList.$.isDelete": true }
    }
  )
  </code></pre>