diff --git a/docs/hooks/fields.mdx b/docs/hooks/fields.mdx index 4c2d2867e9..308d87bcee 100644 --- a/docs/hooks/fields.mdx +++ b/docs/hooks/fields.mdx @@ -48,7 +48,7 @@ All field-level hooks are formatted to accept the same arguments, although some Tip:
- It's a good idea to conditionally scope your logic based on which operation is executing. + It's a good idea to conditionally scope your logic based on which operation is executing. For example, if you are writing a beforeChange hook, you may want to perform different logic based on if the current operation is create or update.
#### Arguments @@ -57,10 +57,10 @@ Field Hooks receive one `args` argument that contains the following properties: | Option | Description | | ----------------- | -------------| -| **`value`** | The value of the field, before any updating. Will return `undefined` within `create` operations. | -| **`data`** | The data passed to update the field with in `create` and `update` operations. | -| **`originalDoc`** | The full original document in `update` or `read` operations. | -| **`operation`** | A string relating to which operation the field type is currently executing within. | +| **`value`** | The value of the field. | +| **`data`** | The data passed to update the field with in `create` and `update` operations, and the full document itself in the `afterRead` hook. | +| **`originalDoc`** | The full original document in `update` operations. | +| **`operation`** | A string relating to which operation the field type is currently executing within. Useful within `beforeValidate`, `beforeChange`, and `afterChange` hooks to differentiate between `create` and `update` operations. | | **`req`** | The Express `request` object. It is mocked for Local API operations. | #### Return value