Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BelongsToManyCreateAssociationMixin<TAttributes, TJoinTableAttributes>

The createAssociation 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...
   createRole: Sequelize.BelongsToManyCreateAssociationMixin<RoleAttributes, UserRoleAttributes>;
   // removeRole...
   // removeRoles...
   // hasRole...
   // hasRoles...
   // countRoles...
}
see

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

see

Instance

Type parameters

  • TAttributes

  • TJoinTableAttributes

Hierarchy

  • BelongsToManyCreateAssociationMixin

Callable

  • Create a new instance of the associated model and associate it with this.

    
    User.belongsToMany(Role, { through: UserRole });
    
    interface UserInstance extends Sequelize.Instance<UserInstance, UserAttributes>, UserAttributes {
       // getRoles...
       // setRoles...
       // addRoles...
       // addRole...
       createRole: Sequelize.BelongsToManyCreateAssociationMixin<RoleAttributes, UserRoleAttributes>;
       // removeRole...
       // removeRoles...
       // hasRole...
       // hasRoles...
       // countRoles...
    }
    

    Parameters

    Returns Promise<void>

Generated using TypeDoc