— database, sequelize, postgresql, code snippet, today-i-learned — 1 min read
Associations have always confused me. Plus with the added typescript definitions and stuff, it's even more confusing. But I was really happy that in the midst of the haze about associations, I understood something and did it right!
The gist listed below helped me with the grokking.
References:
SO Question - Sequelize - include table through another table
SO Question - How to use an include with attributes with sequelize?
Gist - 'Include' in Sequelize: The One Confusing Query That You Should Memorize