Page Contents
Home > @loopback/repository > HasManyThroughRepository > create
HasManyThroughRepository.create() method
Create a target model instance
Signature:
create(targetModelData: DataObject<Target>, options?: Options & {
throughData?: DataObject<Through>;
throughOptions?: Options;
} & {
polymorphicType?: string;
}): Promise<Target>;
Parameters
Parameter | Type | Description |
---|---|---|
targetModelData | DataObject<Target> | The target model data |
options | Options & { throughData?: DataObject<Through>; throughOptions?: Options; } & { 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