@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
39 lines (25 loc) • 1.39 kB
Markdown
---
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) > [@loopback/repository](./repository.md) > [HasOneRepository](./repository.hasonerepository.md) > [delete](./repository.hasonerepository.delete.md)
## HasOneRepository.delete() method
Delete the related target model instance
**Signature:**
```typescript
delete(options?: Options & {
polymorphicType?: string | string[];
}): Promise<Count>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| options | [Options](./repository.options.md) & { polymorphicType?: string \| string\[\]; } | _(Optional)_ 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 |
**Returns:**
Promise<[Count](./repository.count.md)<!-- -->>
A promise which resolves the deleted target model instances