Page Contents

Home > @loopback/repository > constrainWhere

constrainWhere() function

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

Signature:

export declare function constrainWhere<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

Returns:

Where<T>

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