query.withRangeFilters() function
Rewrites <column>Range filter properties onto the columns they belong to.
Signature:
export function withRangeFilters(filter: any): any;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
filter |
any |
Filter to rewrite in place. |
Returns:
any
The same filter, with ranges moved onto their columns.
Remarks
The convention that lets a range be filtered over RPC: a caller sends durationRange: { start, end } and this moves it to duration, where query.toWhereOptions() turns it into a BETWEEN. Recognition is strict — the property name must end in Range and the value must have exactly the keys start and end, in either order. Anything else is left untouched and filtered as an ordinary value, and nested objects are walked so a range on a related model works too.
Sending both duration and durationRange throws rather than choosing one.
MUTATES and returns the filter it is given.