@loopback/docs
Version:
Documentation for LoopBack 4
37 lines (23 loc) • 982 B
Markdown
lang: en
title: 'API docs: repository.entitycrudrepository.exists'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.entitycrudrepository.exists.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository](./repository.md) > [EntityCrudRepository](./repository.entitycrudrepository.md) > [exists](./repository.entitycrudrepository.exists.md)
## EntityCrudRepository.exists() method
Check if an entity exists for the given id
<b>Signature:</b>
```typescript
exists(id: ID, options?: Options): Promise<boolean>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| id | <code>ID</code> | Value for the entity id |
| options | <code>Options</code> | Options for the operations |
<b>Returns:</b>
`Promise<boolean>`
Promise<true> if an entity exists for the id, otherwise Promise<false>