---
lang: en
title: 'API docs: repository.hasonerepository.patch'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.hasonerepository.patch.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [HasOneRepository](./repository.hasonerepository.md) &gt; [patch](./repository.hasonerepository.patch.md)

## HasOneRepository.patch() method

Patch the related target model instance

<b>Signature:</b>

```typescript
patch(dataObject: DataObject<Target>, options?: Options): Promise<Count>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  dataObject | <code>DataObject&lt;Target&gt;</code> | The target model fields and their new values to patch |
|  options | <code>Options</code> |  |

<b>Returns:</b>

`Promise<Count>`

A promise which resolves the patched target model instances


