---
lang: en
title: 'API docs: repository.hasonerepository.delete'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.hasonerepository.delete.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; [delete](./repository.hasonerepository.delete.md)

## HasOneRepository.delete() method

Delete the related target model instance

<b>Signature:</b>

```typescript
delete(options?: Options & {
        polymorphicType?: string | string[];
    }): Promise<Count>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  options | [Options](./repository.options.md) &amp; { polymorphicType?: string \| string\[\]; } | <i>(Optional)</i> options.polymorphicType - a string or a string array of polymorphic type names to specify which repositories should are expected to be searched It is highly recommended to contain this param especially for datasources using deplicated ids across tables |

<b>Returns:</b>

Promise&lt;[Count](./repository.count.md)<!-- -->&gt;

A promise which resolves the deleted target model instances


