Legacy Version
These are the docs for Directus 8, a legacy version of the platform. If you're looking for the current Directus 9 documentation, go here: https://docs.directus.io
Field Types
To support multiple SQL vendors (MySQL, PostgreSQL, MS-SQL, etc) Directus has a generalized set of field types to define API output (
array
,json
,boolean
, etc) and system data (m2o
,alias
,group
, etc).
alias
– Fields that do not have corresponding column in the databasearray
– Standard array format in API responsebinary
– Binary strings limited by its lengthboolean
–true
orfalse
datetime
– A date and time in ISO format, eg:2018-09-19T14:00:43+00:00
date
– Date, eg:2018-09-19
time
– Time, eg:14:09:22
file
– Foreign key todirectus_files.id
group
– Groups fields together visually, children save group intodirectus_fields.group
hash
– Its value gets hashed based on thehasher
option. (Default to:password_hash.PASSWORD_DEFAULT
)integer
– Whole numberdecimal
– Number that includes a decimaljson
– Standard JSON format in API responselang
– Specific to translation interfaces, this stores the language keym2o
– Many-to-One Relationshipo2m
– One-to-Many Relationshipslug
– Removes all the special characters from another field. It will ignore the mirrored field value if the slug already has a value set.sort
– System field that stores a item order within the collection itemsstatus
– System field used for publishing workflowsstring
– Any text or characters, limited by its lengthtranslation
– Specific to translation interfaces, this is ao2m
for multi-lingual contentuuid
– A Universally Unique Identifierdatetime_created
– System field to track the datetime an item was created, used by revisionsdatetime_updated
– System field to track the datetime an item was updated, used by revisionsuser_created
– System field to track the user who created an item, used by revisionsuser_updated
– System field to track the user who updated an item, used by revisions
Datatypes
When creating or updating fields you can also set a vendor-specific datatype for more granular DBA control over data storage.