Sequelize Associations
There are is four type of associations.
A.hasOne(B); // A is source and B is target
A.belongsTo(B);
A.hasMany(B);
A.belongsToMany(B, { through: 'C' });
The A.hasOne(B) mean, foreign key defined in the target model (B).
The A.belongsTo(B) foreig...
thilina.hashnode.dev1 min read