commitTs
commitTs<
TCollectionSlug,TFieldKey,TFieldMeta>(options?):CommitTsField<TCollectionSlug,TFieldMeta>
Defined in: packages/core/src/fields/commitTs/config.ts:46
Creates a commitTs() field with all defaults applied.
commitTs fields store Convex’s own commit-serialization clock value
(ctx.db.vars.commitTs) — a database-stamped Unix-nanosecond timestamp,
never a client-supplied value. Always read-only; stamped automatically by
stampCommitTsFields on the write events named by on.
Accepts CommitTsFieldInput (all optional) and returns CommitTsField with all defaults applied.
Defaults applied:
label—""(inferred from the field key bydefineCollection)on—"save"admin.hidden—falseadmin.readOnly— alwaystrueadmin.position—"main"admin.width—"100%"admin.cellAlignment—"left"admin.enableSorting—true(always has an auto-index, perresolveCollectionIndexes)admin.format—"datetime"
Type Parameters
Section titled “Type Parameters”TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends string = string
TFieldKey
Section titled “TFieldKey”TFieldKey extends string = never
TFieldMeta
Section titled “TFieldMeta”TFieldMeta extends BaseFieldMeta = BaseFieldMeta
Parameters
Section titled “Parameters”options?
Section titled “options?”CommitTsFieldInput<TCollectionSlug, TFieldKey, TFieldMeta>
commitTs field configuration. All properties are optional.
Returns
Section titled “Returns”CommitTsField<TCollectionSlug, TFieldMeta>
Resolved commitTs field definition with all defaults applied.
Example
Section titled “Example”import { commitTs, defineCollection } from '@vexcms/core'
posts: defineCollection({ fields: { updatedAt: commitTs(), publishedCommitTs: commitTs({ on: "publish" }), }})- CommitTsFieldInput for the full input type
- CommitTsField for the resolved output type