Answer the question
In order to leave comments, you need to log in
Why doesn't mongoose update the document?
User.findOne({ userId: userid }, function (err, user) {
if (err) return console.log('ERROR');
user.lvl += 1;
user.save((err, doc) => {
if (err) return console.log('save error!');
console.log('Saved user: ', doc);
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question