There are few ways to update the document record in MongoDB database.
With the User model defined I can find the user first, then modify its attribute and save it with the save() method:
let user = await User.findOne({"email": "user@email.com"});
user["email"] = "another@email.com";
await user.save();
Another option would be to use updateOne method instead of save:
await user.updateOne({"email": "another@email.com"});
Why would I choose to use the updateOne method over the save? What are the pros and cons?