Replaced all findByid-edit-save() logic on the models with findByIdAndUpdate().
This cleans up the code and fixes another bug that hashes the user's password everytime you do User.find execute some logic, edit some data and then user.save() for example, because of the User.pre('save') middleware on the user's model which is used to hash the user's password before saving the user in the database.
Replaced all findByid-edit-save() logic on the models with findByIdAndUpdate(). This cleans up the code and fixes another bug that hashes the user's password everytime you do User.find execute some logic, edit some data and then user.save() for example, because of the User.pre('save') middleware on the user's model which is used to hash the user's password before saving the user in the database.