You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I dug deep enough (2016) and found only hints that such feature would be awesome to have but is not yet supported.
What is current best way to update models with associations? I understand it might be hard to implement, but I couldn't find in the docs how to do it on your own.
I think that feature isn't supported yet. you can fetch a row from any table and it will be a model instance, so if you include associated models they will be model instances too. for example:
student.Classroom will be an instance of model Classroom and you can call student.Classroom.save() to update classroom. but calling student.save() only update students atributes
Activity
amgv commentedon Mar 19, 2018
I think that feature isn't supported yet. you can fetch a row from any table and it will be a model instance, so if you include associated models they will be model instances too. for example:
Student.find({ where: {age: 14}, include: [Classroom],}). then((student) => {})student.Classroomwill be an instance of model Classroom and you can callstudent.Classroom.save()to update classroom. but callingstudent.save()only update students atributesacanimal commentedon Mar 20, 2018
Maybe #9204 can help you
sushantdhiman commentedon Mar 25, 2018
Duplicate of #9233
papb commentedon Jan 16, 2020
This has been centralized in #11836