I have mostly seen "pre" function to be used as userSchema.pre('save', async function(){..}) while using bcrypt in express.
I know it is a middleware, runs before .save() function to encrypt password but what is the logic of using "pre" with userSchema?.. like userSchema.pre()
↧
Why "pre" function is mostly used with userSchema while using bcryptjs?
↧