Skip to content

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.

Hooks that are meant to be used with transformers:

  • transformData: Transforms the data before it is sent to the database.
  • transformResult: Transforms the result after it has been retrieved from the database.
  • transformQuery: Transforms the query parameters before they are sent to the database.

Utils that are meant to be used with transformers:

lowercase

Transforms the specified fields of an item to lowercase.

omit

Omit the specified fields from an item.

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.

Released under the MIT License.