@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
43 lines (29 loc) • 1.68 kB
Markdown
---
lang: en
title: 'API docs: repository.hasmanythroughrepository.create'
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.hasmanythroughrepository.create.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository](./repository.md) > [HasManyThroughRepository](./repository.hasmanythroughrepository.md) > [create](./repository.hasmanythroughrepository.create.md)
## HasManyThroughRepository.create() method
Create a target model instance
**Signature:**
```typescript
create(targetModelData: DataObject<Target>, options?: Options & {
throughData?: DataObject<Through>;
throughOptions?: Options;
} & {
polymorphicType?: string;
}): Promise<Target>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| targetModelData | [DataObject](./repository.dataobject.md)<!-- --><Target> | The target model data |
| options | [Options](./repository.options.md) & { throughData?: [DataObject](./repository.dataobject.md)<!-- --><Through>; throughOptions?: [Options](./repository.options.md)<!-- -->; } & { polymorphicType?: string; } | _(Optional)_ Options for the operation options.polymorphicType a string or a string array of polymorphic type names specify of which concrete model the created instance should be |
**Returns:**
Promise<Target>
A promise which resolves to the newly created target model instance