---
lang: en
title: 'API docs: repository.hasonerepository'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.hasonerepository.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)

## HasOneRepository interface

CRUD operations for a target repository of a HasMany relation

<b>Signature:</b>

```typescript
export interface HasOneRepository<Target extends Entity> 
```

## Methods

|  Method | Description |
|  --- | --- |
|  [create(targetModelData, options)](./repository.hasonerepository.create.md) | Create a target model instance |
|  [delete(options)](./repository.hasonerepository.delete.md) | Delete the related target model instance |
|  [get(filter, options)](./repository.hasonerepository.get.md) | Find the only target model instance that belongs to the declaring model. |
|  [patch(dataObject, options)](./repository.hasonerepository.patch.md) | Patch the related target model instance |


