Documentation
    Preparing search index...

    Type Alias HasManySetAssociationsMixin<T, TModelPrimaryKey>

    HasManySetAssociationsMixin: (
        newAssociations?: Iterable<T | TModelPrimaryKey> | null,
        options?: HasManySetAssociationsMixinOptions<T>,
    ) => Promise<void>

    The setAssociations mixin applied to models with hasMany. An example of usage is as follows:

    class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> {
    declare setRoles: HasManySetAssociationsMixin<Role, Role['id']>;
    }

    User.hasMany(Role);

    Type Parameters

    • T extends Model
    • TModelPrimaryKey

    Type Declaration

    Model.hasMany