I want my pre('save') mongoose function to operate only once
问题 I do not know if the exact request in title is possible, but if not; i would really appreciate an alternate solution. I have this pre save method of mongoose ownerSchema.pre("save", function(next) { const owner = this; bcrypt.genSalt(10, function(err, salt) { bcrypt.hash(owner.password, salt, function(err, hash) { // Store hash in your password DB. owner.password = hash; next(); }); }); }); When i save new user(owner) a hash is created successfully and all is good> The problem occurs when i