您必须在更新任何内容之前先找到文档:
Place.findById(req.params.id, function(err, p) { if (!p) return next(new Error('Could not load document')); else { // do your updates here p.modified = new Date(); p.save(function(err) { if (err) console.log('error') else console.log('success') }); }});使用与您相同的设置在生产代码中为我工作。您可以使用mongoose提供的任何其他find方法来代替findById。只要确保在更新文档之前先获取文档即可。



