【发布时间】:2018-12-28 09:13:00
【问题描述】:
尝试更新 MongoDB 文档获取弃用警告为
(node:71307) [DEP0079] DeprecationWarning: 自定义检查功能 不推荐使用通过 .inspect() 处理对象
节点版本v10.5.0, 数据库版本 v3.6.5, 猫鼬版mongoose@4.1.12
Campground.findById(campgroundId, function(err, campground){
if(err){
console.log(err);
} else {
console.log(campground.celebrity);
Celebrity.create(celebrityData, function(err, celebrity){
if(err){
console.log(err);
} else {
//save comment
celebrity.save();
campground.celebrity.push(celebrity);
campground.save();
console.log(celebrity);
//req.flash('success', 'Created a comment!');
}
});
}
});
【问题讨论】:
-
请提及您的节点和猫鼬版本。
-
猫鼬版?
-
猫鼬版 mongoose@4.1.12
-
这种减弱现在会出现在猫鼬中。他们会做这方面的工作。现在它可以安全地使用它。没什么好担心的。
标签: javascript node.js mongodb mongoose mongoose-schema