sequelize.js - sequelize oneToMany create nested associations -


is there way have sequelize create nested associations via single create call? example if have model data hasmany of model user, , each user hasmany of model permission. there way call data.create data containing user , permission, , sequelize create nested associations?

the thing i've found on sequelize docs using include pull in nested associations on find call, or calling setter after data.create, e.g. data.setusers(...).

as far know, can done if records new. in case means having new data new users have new permissions. otherwise, you'll have "manual" way.

for more info, see documentation here: http://docs.sequelizejs.com/en/latest/docs/associations/#creating-with-associations


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

delphi - Take screenshot in webcam using VFrames in Console Application -

c++ - Migration from QScriptEngine to QJSEngine -