// 更新// ret 返回旧对象// 第一个参数为id,第二个参数为 要修改的项,第三个参数为 callback 回调函数User.findByIdAndUpdate('5d144ecd02f84c2908bf70e2', {username: 'MangoLee',password: 1234567}, (err, ret) => {if (err) {return console.log(err)}console.log('更新成功')console.log(ret)})// 根据条件更新所有User.update(conditions, [options], [callback])// 根据条件更新一个User.findOneAndUpdate(conditions, [update], [options], [callback])
