@loopback/docs
Version:
Documentation for LoopBack 4
36 lines (23 loc) • 893 B
Markdown
lang: en
title: 'API docs: repository.wherebuilder.exists'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.wherebuilder.exists.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository](./repository.md) > [WhereBuilder](./repository.wherebuilder.md) > [exists](./repository.wherebuilder.exists.md)
## WhereBuilder.exists() method
Add a `exists` condition
<b>Signature:</b>
```typescript
exists<K extends KeyOf<MT>>(key: K, val?: boolean): this;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | <code>K</code> | Property name |
| val | <code>boolean</code> | Exists or not |
<b>Returns:</b>
`this`