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});
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