Can I check if document exists and then update it in one query?
I tried to do it like bellow with JavaScript promise, but result is always 'Your account has been activated!'.
I deleted all documents in my database, so result intantionally would be negative, but even so result is 'Your account has been activated!'
usersCollection.findOneAndUpdate({"activationLink": activationLink}, {"$set": {"isActivated": true}}).then(function(userDoc) {
if (userDoc) {
console.log('Your account has been activated!')
} else {
console.log('This account does not exist!')
}).catch((e) => {
console.log(e)
})