transformQuery
See also: transformers
Transforms the query object.
ts
import { transformQuery } from 'feathers-utils/hooks';Type declaration
ts
/**
* Transforms the query object.
*/
export declare const transformQuery: <
Q extends Query,
H extends HookContext = HookContext,
>(
transformer: TransformerFn<Q, H>,
) => (context: H, next?: NextFunction) => any| Argument | Type | Description |
|---|---|---|
| transformer | TransformerFn<Q, H> |
| type | methods | multi |
|---|---|---|
| before, after, around | all | yes |
transformQuery is a hook that allows you to transform the query parameters before they are sent to the database. This can be useful for modifying the query structure, adding default values, or applying transformations to the query fields.
Transformers
'feathers-utils' provides a set of transformers that can be used with this hook. These transformers can be used to trim strings, convert dates, or omit fields from the query.
