74
rated 0 times
[
77]
[
3]
/ answers: 1 / hits: 35068
/ 10 Years ago, wed, november 19, 2014, 12:00:00
Is possible to add multiple rows at once from array with sequelize.js? This is my code:
var user = User.build({
email: req.body.email,
password: req.body.password,
userlevel: '3',
});
User
.find({ where: { email: req.body.email } })
.then(function(existingUser){
if (existingUser) {
return res.redirect('/staff');
}
user
.save()
.complete(function(err){
if (err) return next(err);
res.redirect('/staff');
});
}).catch(function(err){
return next(err);
});
Thanks for any advise!
More From » orm