---
lang: en
title: 'API docs: repository.wherebuilder.exists'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.wherebuilder.exists.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [WhereBuilder](./repository.wherebuilder.md) &gt; [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`


