Transformers
Transformers are functions that modify the data or result of a Feathers service call. They can be used to apply transformations such as trimming strings, converting dates, or omitting fields from the data or result.
Built-in Transformers
| Transformer | Description |
|---|---|
lowercase | Transforms the specified fields of an item to lowercase. |
omit | Omit the specified fields from an item. |
parseDate | Parses the specified fields of an item into Date objects. |
pick | Picks the specified fields from an item. |
setNow | Sets the specified fields of an item to the current date and time. |
trim | Trims the specified fields of an item. |
Hooks that are meant to be used with transformers:
| Hook | Description |
|---|---|
transformData | Transforms each item in |
transformQuery | Transforms |
transformResult | Transforms each item in |
Utilities that are meant to be used with transformers:
| Utility | Description |
|---|---|
mutateData | Applies a transformer function to each item in |
mutateResult | Applies a transformer function to each item in |
