---
lang: en
title: 'API docs: repository.constrainwhereor'
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.constrainwhereor.html
---

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [constrainWhereOr](./repository.constrainwhereor.md)

## constrainWhereOr() function

A utility function which takes a where filter and enforces constraint(s) on it with OR clause

<b>Signature:</b>

```typescript
export declare function constrainWhereOr<T extends object>(originalWhere: Where<T> | undefined, constraint: Where<T>[]): Where<T>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  originalWhere | [Where](./filter.where.md)<!-- -->&lt;T&gt; \| undefined | the where filter to apply the constrain(s) to |
|  constraint | [Where](./filter.where.md)<!-- -->&lt;T&gt;\[\] | the constraint which is to be applied on the filter with or clause |

<b>Returns:</b>

[Where](./filter.where.md)<!-- -->&lt;T&gt;

Filter the modified filter with the constraint, otherwise the original filter


