Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BelongsToManyAddAssociationMixin<TInstance, TInstancePrimaryKey, TJoinTableAttributes>

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...
}
see

http://docs.sequelizejs.com/en/latest/api/associations/belongs-to-many/

see

Instance

Type parameters

  • TInstance

  • TInstancePrimaryKey

  • TJoinTableAttributes

Hierarchy

  • BelongsToManyAddAssociationMixin

Callable

  • 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...
    }
    

    Parameters

    Returns Promise<void>

Generated using TypeDoc