Page Contents

Home > @loopback/repository > constrainWhereOr

constrainWhereOr() function

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

Signature:

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

Parameters

Parameter Type Description
originalWhere Where<T> | undefined the where filter to apply the constrain(s) to
constraint Where<T>[] the constraint which is to be applied on the filter with or clause

Returns:

Where<T>

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