Page Contents

Home > @loopback/repository > HasOneDefinition

HasOneDefinition interface

Signature:

export interface HasOneDefinition extends RelationDefinitionBase 

Properties

Property Type Description
keyTo string The foreign key used by the target model.E.g. when a Customer has one Address instance, then keyTo is “customerId”. Note that “customerId” is the default FK assumed by the framework, users can provide a custom FK name by setting “keyTo”.
targetsMany false  
type RelationType.hasOne