Advertisement
Guest User

Untitled

a guest
Mar 12th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. UserSchema.pre('save', function (next) {
  2. //contents of function
  3. });
  4.  
  5. module.exports = mongoose.model('User', UserSchema);
  6.  
  7. var newUser = new User({
  8. firstName: req.body.firstName,
  9. lasttName: req.body.lastName,
  10. email: req.body.email,
  11. password: req.body.password
  12. });
  13. // save the user
  14. newUser.save(function(err) {
  15. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement