create record mongoose model

Solutions on MaxInterview for create record mongoose model by the best coders in the world

showing results for - "create record mongoose model"
Dario
13 Oct 2016
1var _user = new UserModel({
2      id: profile.id,
3      name: profile.name,
4  });
5
6_user.save(function (err,user) {
7    if (err)  console.log(err);
8    console.log("saved");
9});
Orlane
07 Feb 2016
1   // Create new user.
2   let newUser = {
3       username: req.body.username,
4       password: passwordHashed,
5       salt: salt,
6       authorisationKey: authCode
7   };
8
9   // From require('UserModel');
10   return ModelUser.create(newUser);
11