Skip to content

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 by defineCollection)
  • on — "save"
  • admin.hidden — false
  • admin.readOnly — always true
  • admin.position — "main"
  • admin.width — "100%"
  • admin.cellAlignment — "left"
  • admin.enableSorting — true (always has an auto-index, per resolveCollectionIndexes)
  • admin.format — "datetime"

TCollectionSlug extends string = string

TFieldKey extends string = never

TFieldMeta extends BaseFieldMeta = BaseFieldMeta

CommitTsFieldInput<TCollectionSlug, TFieldKey, TFieldMeta>

commitTs field configuration. All properties are optional.

CommitTsField<TCollectionSlug, TFieldMeta>

Resolved commitTs field definition with all defaults applied.

import { commitTs, defineCollection } from '@vexcms/core'
posts: defineCollection({
fields: {
updatedAt: commitTs(),
publishedCommitTs: commitTs({ on: "publish" }),
}
})