Page Contents

Home > @loopback/repository > HasManyThroughDefinition

HasManyThroughDefinition interface

A hasManyThrough relation defines a many-to-many connection with another model. This relation indicates that the declaring model can be matched with zero or more instances of another model by proceeding through a third model.

Warning: The hasManyThrough interface is experimental and is subject to change. If backwards-incompatible changes are made, a new major version may not be released.

Signature:

export interface HasManyThroughDefinition extends RelationDefinitionBase 

Properties

Property Type Description
keyFrom string The foreign key in the source model, e.g. Customer#id.
keyTo string The primary key of the target model, e.g Seller#id.
targetsMany true  
through {
model: TypeResolver<Entity, typeof Entity>;
keyFrom: string;
keyTo: string;
}
 
type RelationType.hasMany