Quantcast
Channel: Active questions tagged mongodb-atlas - Stack Overflow
Viewing all articles
Browse latest Browse all 271

Why "pre" function is mostly used with userSchema while using bcryptjs?

$
0
0

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()


Viewing all articles
Browse latest Browse all 271

Trending Articles