Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 381 Bytes

File metadata and controls

29 lines (23 loc) · 381 Bytes

Section 53.3: Insert data

  • ECMA 6:
const user = new User({
  name: 'Stack',
  password: 'Overflow',
}) ;

user.save((err) => {
  if (err) throw err;
  console.log('User saved!');
});
  • ECMA5.1:
var user = new User({
  name: 'Stack',
  password: 'Overflow',
}) ;

user.save(function (err) {
  if (err) throw err;
  console.log('User saved!');
});