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

ios - Is 'init' forbidden as *part* of a variable name? -

angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -

javascript - Why Selenium can't find an element that is graphically visible -