Page Contents
Home > @loopback/repository > HasManyThroughRepository > patch
HasManyThroughRepository.patch() method
Patch multiple target model instances
Signature:
patch(dataObject: DataObject<Target> | {
[polymorphicType: string]: DataObject<Target>;
}, where?: Where<Target>, options?: Options & {
throughOptions?: Options & {
discriminator?: string;
};
} & {
isPolymorphic?: boolean;
}): Promise<Count>;
Parameters
Parameter | Type | Description |
---|---|---|
dataObject | DataObject<Target> | { [polymorphicType: string]: DataObject<Target>; } | The fields and their new values to patch |
where | Where<Target> | (Optional) Instances within the where scope are patched |
options | Options & { throughOptions?: Options & { discriminator?: string; }; } & { isPolymorphic?: boolean; } | (Optional) options.throughOptions.discriminator - target discriminator field on through options.isPolymorphic - whether dataObject is a dictionary |
Returns:
Promise<Count>
A promise which resolves the patched target model instances