UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

33 lines (23 loc) 1.94 kB
--- lang: en title: 'API docs: repository.relationdefinitionbase' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/strongloop/loopback-next/tree/master/packages/repository permalink: /doc/en/lb4/apidocs.repository.relationdefinitionbase.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [RelationDefinitionBase](./repository.relationdefinitionbase.md) ## RelationDefinitionBase interface <b>Signature:</b> ```typescript export interface RelationDefinitionBase ``` ## Properties | Property | Type | Description | | --- | --- | --- | | [name](./repository.relationdefinitionbase.name.md) | string | The relation name, typically matching the name of the accessor property defined on the source model. For example "orders" or "customer". | | [source](./repository.relationdefinitionbase.source.md) | typeof [Entity](./repository.entity.md) | The source model of this relation.<!-- -->E.g. when a Customer has many Order instances, then Customer is the source. | | [target](./repository.relationdefinitionbase.target.md) | [TypeResolver](./repository.typeresolver.md)<!-- -->&lt;[Entity](./repository.entity.md)<!-- -->, typeof [Entity](./repository.entity.md)<!-- -->&gt; | The target model of this relation.<!-- -->E.g. when a Customer has many Order instances, then Order is the target. | | [targetsMany](./repository.relationdefinitionbase.targetsmany.md) | boolean | True for relations targeting multiple instances (e.g. HasMany), false for relations with a single target (e.g. BelongsTo, HasOne). This property is needed by OpenAPI/JSON Schema generator. | | [type](./repository.relationdefinitionbase.type.md) | [RelationType](./repository.relationtype.md) | The type of the relation, must be one of RelationType values. |