Page Contents

Home > @loopback/repository > BelongsToDefinition

BelongsToDefinition interface


export interface BelongsToDefinition extends RelationDefinitionBase 

Extends: RelationDefinitionBase


Property Type Description
keyFrom? string (Optional)
keyTo? string (Optional)
polymorphic? boolean | { discriminator: string; } (Optional) The polymorphism of the target model. The discriminator is a key of source model. If the target model is not polymorphic, then the value should be left undefined or false; If the key on source model indicating the concrete class of the target instance is default i.e. camelCase(classNameOf(throughModelInstance)) + “Id” Then the discriminator field can be undefined
targetsMany false  
type RelationType.belongsTo