Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UserSchema.pre('save', function (next) {
- //contents of function
- });
- module.exports = mongoose.model('User', UserSchema);
- var newUser = new User({
- firstName: req.body.firstName,
- lasttName: req.body.lastName,
- email: req.body.email,
- password: req.body.password
- });
- // save the user
- newUser.save(function(err) {
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement