O'Reilly logo
  • Patrick S thinks this is interesting:

The first way is to chain the newUser and .save commands into one line, for example:

var newUser = new User({
  name: 'Simon Holmes',
  email: 'simon@theholmesoffice.com',
  lastLogin : Date.now()
}).save( function( err ){
  if(!err){
    console.log('User saved!');
  }
});

From

Cover of Mongoose for Application Development

Note

create and save new user