Page Contents
  
 
    
Home > @loopback/repository > HasManyThroughRepository > link
HasManyThroughRepository.link() method
Creates a new many-to-many association to an existing target model instance
Signature:
link(targetModelId: TargetID, options?: Options & {
        throughData?: DataObject<Through>;
        throughOptions?: Options;
    }): Promise<void>;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| targetModelId | TargetID | The target model ID to link | 
| options | Options & { throughData?: DataObject<Through>; throughOptions?: Options; } | 
Returns:
Promise<void>
A promise which resolves to the linked target model instance