我使用 猫鼬库通过 node.js 访问 MongoDB
有没有一种方法可以实现 从文档中删除密钥? 也就是说,不仅要将值设置为 null,还要删除它?
User.findOne({}, function(err, user){
//correctly sets the key to null... but it's still present in the document
user.key_to_delete = null;
// doesn't seem to have any effect
delete user.key_to_delete;
user.save();
});