From bd19fcf2594feff032c16e40e0e015393a147c8d Mon Sep 17 00:00:00 2001 From: Jessica Chowdhury <67977755+JessChowdhury@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:32:34 -0400 Subject: [PATCH] chore(docs): expand on reserved field names (#7242) ## Description Closes #6640 Note: Only updated for v2 as the v3 docs cover this topic already. - [X] I have read and understand the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository. ## Type of change - [X] Chore (non-breaking change which does not add functionality) --- docs/fields/overview.mdx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/fields/overview.mdx b/docs/fields/overview.mdx index 763c47298b..40fb9953e5 100644 --- a/docs/fields/overview.mdx +++ b/docs/fields/overview.mdx @@ -70,7 +70,16 @@ In addition to being able to define access control on a document-level, you can ### Field names -Some fields use their `name` property as a unique identifier to store and retrieve from the database. `__v`, `salt`, and `hash` are all reserved field names which are sanitized from Payload's config and cannot be used. +All fields require a `name` property. This is the key that will be used to store and retrieve the field's value in the database. This property must be unique within the Collection, Global, or nested group that it is defined in. + +Payload reserves various field names for internal use. Using reserved field names will result in your field being sanitized from the config. + +The following field names are forbidden and cannot be used: + + - `__v` + - `salt` + - `hash` + - `file` ### Validation