📅  最后修改于: 2022-03-11 15:02:31             🧑  作者: Mango
const filter = { age: 17 };
const doc = { $set: { name: "Naomi" } };
const options = { new: true };
Cat.findOneAndUpdate(filter, doc, options, (err, doc) => {
if (err) console.log("Something wrong when updating data!");
console.log(doc);
});