state update with find methode code example
Example: is find one and update returning updated state?
// Pass {new: true} if you want the updated result in the doc variable:
Cat.findOneAndUpdate({age: 17}, {$set:{name:"Naomi"}}, {new: true}, (err, doc) => {
if (err) {
console.log("Something wrong when updating data!");
}
console.log(doc);
});