GlobalBeforeChangeProps
Defined in: packages/core/src/globals/hooks.ts:7
Arguments passed to a global’s beforeChange hook.
Extends
Section titled “Extends”BaseHookProps<TDataModel>
Type Parameters
Section titled “Type Parameters”TGlobalSlug
Section titled “TGlobalSlug”TGlobalSlug extends GlobalSlug = GlobalSlug
TDataModel
Section titled “TDataModel”TDataModel extends GenericDataModel = GenericDataModel
Properties
Section titled “Properties”commitTs
Section titled “commitTs”commitTs:
unknown
Defined in: packages/core/src/hooks/types.ts:29
This write’s unresolved ctx.db.vars.commitTs placeholder — the same
value stampCommitTsFields writes into a matching commitTs() field.
A hook MAY use it to stamp a RELATED document in the same mutation
(e.g. a parent row’s own commitTs field). It is NOT the resolved
value — Convex resolves a commitTs placeholder only after the
mutation commits, so reading it as a number/bigint here throws or
returns the placeholder object itself, never a usable timestamp.
Inherited from
Section titled “Inherited from”ctx:
GenericMutationCtx<TDataModel>
Defined in: packages/core/src/hooks/types.ts:19
Inherited from
Section titled “Inherited from”doc:
DocumentByGlobalSlug<TGlobalSlug>
Defined in: packages/core/src/globals/hooks.ts:14
The merged user fields about to be validated and written. Return the (possibly transformed) document.
global
Section titled “global”global:
GlobalConfig<{ }, { },TGlobalSlug>
Defined in: packages/core/src/globals/hooks.ts:16
The resolved config of the global this write is running on.
operation
Section titled “operation”operation:
"create"|"update"
Defined in: packages/core/src/globals/hooks.ts:12
"create" on the global’s first-ever save, "update" afterwards.