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 -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -