Friday, March 3, 2017

Mongoose findByIdAndUpdate does not return updated object

Here is the code

You will find the product is the one before update. But usually we need return the one after update. To do that, we need add option {new:true}
http://stackoverflow.com/questions/30419575/mongoose-findbyidandupdate-not-returning-correct-model

No comments:

Post a Comment