User is the basic schema I created with a name, email, and password. But when I try to update it no errors occur yet the collection in mongodb doesn't change. Tried the {strict: false} option on the schema but sadly that just adds another object to it, debbuging mode didn't help much either so now I am stuck with no clues how to go about solving this. Any advice as to what might be happening? mongoose version is 6.0.12 and mongodb is 4.4.10 if they are of relevance.
// Snippet for the code.
User.findOneAndUpdate({_id: req.body.id}, {updatedUser}, {useFindAndModify: false}, (err) => {
if(!err){
console.log("Managed to update")
res.json({message: "User updated successfully"})
} else {
res.json({message: `Something went wrong please try again => ${err} `})
}
})