使用express框架和mongoose在MongoDB更新数据

update方法  modelName.update({需要替换的内容},{“$set”:{新的内容}},function(err,doc){});

User.update({userName:"zs"},{"$set":{userName:"ls"}},function(err,doc){});
原文地址:https://www.cnblogs.com/luguankun/p/10266652.html