title: Remove from array of objectId using update mongoDB
body: <p>I have a model named courier, it has an array named order and orders has some ObjectIds of model order, how can I remove an element from orders array using update or something else ?</p>
  
  <p>(for example removing an order with specific id)</p>
  
  <p>Here is my model:</p>
  
  <p>courier:</p>
  
  <pre><code>var courierSchema = new Schema({
      name: { type: String },
      orders:[{type:Schema.Types.ObjectId,ref:'order'}],
  });
  </code></pre>
  
  <p>I tried this code but it fails :</p>
  
  <pre><code>courier.update({
                     name: 'Mahan'
                 }, {
                      $pull : {
                        orders: {
                            _id: order._id
                        }
                    }
                  }, (err, count, obj) =&gt; {
                      if(err) {
                          console.log(err);
                          return handleError(err, reply);
                      }
                      console.log(count);
                  });
  </code></pre>
  
  <p>Is there any way to do this not using find, remove and then save ?</p>