Associate an instance with this.
User.belongsToMany(Role, { through: UserRole });
interface UserInstance extends Sequelize.Instance<UserInstance, UserAttributes>, UserAttributes {
// getRoles...
// setRoles...
// addRoles...
addRole: Sequelize.BelongsToManyAddAssociationMixin<RoleInstance, RoleId, UserRoleAttributes>;
// createRole...
// removeRole...
// removeRoles...
// hasRole...
// hasRoles...
// countRoles...
}
An instance or the primary key of an instance to associate with this.
The options passed to through.findAll
, bulkCreate
, update
and destroy
. Can also hold additional attributes for the join table.
Generated using TypeDoc
The addAssociation mixin applied to models with belongsToMany. An example of usage is as follows:
User.belongsToMany(Role, { through: UserRole }); interface UserInstance extends Sequelize.Instance<UserInstance, UserAttributes>, UserAttributes { // getRoles... // setRoles... // addRoles... addRole: Sequelize.BelongsToManyAddAssociationMixin<RoleInstance, RoleId, UserRoleAttributes>; // createRole... // removeRole... // removeRoles... // hasRole... // hasRoles... // countRoles... }
http://docs.sequelizejs.com/en/latest/api/associations/belongs-to-many/
Instance