updateOne方法更新了,一定要注意,后面现在得带.then才有用了
router.get('/update',function(req,res){
console.log(req.query);
var nike='wohaoshengqi';
User.updateOne({nickname:'大李'},{nickname:'happy'}).then(rel => {
// rel为修改结果对象
console.log(rel);
})
res.end('hi');
})
啊噩梦般的两个小时,希望大家不要走错路了。