Page Contents
Home > @loopback/repository > HasOneRepository > patch
HasOneRepository.patch() method
Patch the related target model instance
Signature:
patch(dataObject: DataObject<Target> | {
[polymorphicType: string]: DataObject<Target>;
}, options?: Options & {
isPolymorphic?: boolean;
}): Promise<Count>;
Parameters
Parameter | Type | Description |
---|---|---|
dataObject | DataObject<Target> | { [polymorphicType: string]: DataObject<Target>; } | The target model fields and their new values to patch If the target models are of different types, this should be a dictionary |
options | Options & { isPolymorphic?: boolean; } | (Optional) options.isPolymorphic - whether dataObject is a dictionary |
Returns:
Promise<Count>
A promise which resolves the patched target model instances