Files
directus/docs/reference/field-transforms.md
Rijk van Zanten 817ccf3620 Overhaul docs (#3951)
* Add Quickstart Guide

* Update installation

* Remove unused files

* Update support/backing

* Tweaks in concepts

* Setup file structure for API reference 2.0

* Setup page layout for reference

* Add clean-urls plugin

* getting started updates

* Finish authentication rest

* getting started updates

* Render stylus in 2 spaces

* Various

* Various

* Finish activity docs

* Add collections reference

* Add extension reference

* concepts updates

* Fields/tweaks

* Add files doc

* Add revisions

* concepts docs

* More api reference

* Finish rest api reference (finally)

* initial concepts

* More things

* Add assets api ref

* Move sections from file to assets

* Add environment variables

* contributing docs

* Add field transforms page

* Left align table headers

* concept links

* Add API config

* Fix mobile nav

* Add migrating a project

* doc link fixes

Co-authored-by: Ben Haynes <ben@rngr.org>
2021-02-05 18:51:54 -05:00

1.3 KiB

Field Transforms

Directus contains a couple special field flags that can be used to alter the IO of a fields value when it's being used through the API. This is used—among other things—for casting boolean values to JSON true / false, or converting DB-date formats to ISO8601.

These flags are stored in the special field of directus_fields.

toc

Hash

hash

Hash the value using argon2 on create/update.

UUID

uuid

Generate a new UUID on creation.

Boolean

boolean

Cast the value to/from a JSON boolean (true / false).

JSON

json

Cast the value to/from a JSON object.

CSV

csv

Cast the value from a JSON array of strings to a CSV in the database (and vice versa).

Conceal

conceal

Return the value concealed in the API. This will replace the true stored value with ********.

User Created

user-created

Save the currently authenticated user on creation.

User Updated

user-updated

Save the currently authenticated user on update.

Role Created

role-created

Save the currently authenticated user's role on create.

Role Updated

role-updated

Save the currently authenticated user's role on update.

Date Created

date-created

Save the current date on create.

Date Updated

date-updated

Save the current date on update.