📅  最后修改于: 2022-03-11 15:02:12.431000             🧑  作者: Mango
// 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);
});