@loopback/docs
Version:
Documentation for LoopBack 4
38 lines (24 loc) • 1.06 kB
Markdown
---
lang: en
title: 'API docs: repository.crudconnector.deletebyid'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.crudconnector.deletebyid.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository](./repository.md) > [CrudConnector](./repository.crudconnector.md) > [deleteById](./repository.crudconnector.deletebyid.md)
## CrudConnector.deleteById() method
Delete an entity by id
<b>Signature:</b>
```typescript
deleteById?<IdType>(modelClass: Class<Entity>, id: IdType, options?: Options): Promise<boolean>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| modelClass | <code>Class<Entity></code> | The model class |
| id | <code>IdType</code> | The entity id value |
| options | <code>Options</code> | Options for the operation |
<b>Returns:</b>
`Promise<boolean>`
Promise<true> if an entity is deleted for the id, otherwise Promise<false>