---
lang: en
title: 'API docs: repository.belongstodefinition.polymorphic'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.belongstodefinition.polymorphic.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [BelongsToDefinition](./repository.belongstodefinition.md) &gt; [polymorphic](./repository.belongstodefinition.polymorphic.md)

## BelongsToDefinition.polymorphic property

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

**Signature:**

```typescript
polymorphic?: boolean | {
        discriminator: string;
    };
```

