Reputation: 3975
My question is in the function below in the commented code.
newUser = new User();
newUser.save(function(err){
if(err) console.log('error saving user');
// is my user saved at this point? Can I modify
// the user in here or is this pre-save?
});
Upvotes: 0
Views: 32
Reputation: 483
As soon as the code is executed it is saved. There is some validation that occurs in the middleware, but it is instant otherwise.
Upvotes: 1