Hello,I'm new to the forum, and in process of learning Sequelize :)I'm stuck with trying to update two models with belongsToMany association..For instance lets say I have User and Projects.I know that when you make the association, it creates these 'magic functions' like 'addProject', and 'setProject'. But how do you 'updateProject'?For instance, if I want to update the projects assigned to a user, then I would do user.addProjects(projectId).But lets say I want to update a user's project with an array of projects.Something like: user.updateProjects(['4','2','3']). How is that accomplished? Appreciate any input I could get.
Submitted July 31, 2020 at 04:54PM by giantqtipz
No comments:
Post a Comment