javascript - Create multiple rows in table from array? -


is possible add multiple rows @ once array sequelize.js? 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 advise!

http://sequelize.readthedocs.org/en/rtd/api/model/#bulkcreaterecords-options-promisearrayinstance

user.bulkcreate([{ /*  record 1 */ }, { /* record 2 */ }.. ]) 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -