Page Contents
Home > @loopback/repository > constrainFilter
constrainFilter() function
A utility function which takes a filter and enforces constraint(s) on it
Signature:
export declare function constrainFilter<T extends object>(originalFilter: Filter<T> | undefined, constraint: AnyObject): Filter<T>;
Parameters
Parameter | Type | Description |
---|---|---|
originalFilter | Filter<T> | undefined | the filter to apply the constrain(s) to |
constraint | AnyObject | the constraint which is to be applied on the filter |
Returns:
Filter<T>
Filter the modified filter with the constraint, otherwise the original filter