Skip to content

KeyValueField

Defined in: packages/core/src/fields/keyValue/types.ts:125

Resolved configuration for a keyValue() field, after all defaults are applied.

interfaceType is computed PER INSTANCE (Record<string, V> or Record<Id<"slug">, V>) via childInterfaceType(options.value), so a nested select/named group inside value produces the same literal union / named type it would at the top level (P-019).

TCollectionSlug extends VexResourceSlug = VexResourceSlug

TFieldMeta extends object = { }

TKeysSlug extends CollectionSlug = CollectionSlug

admin: KeyValueFieldAdminConfig<TCollectionSlug>

Defined in: packages/core/src/fields/keyValue/types.ts:132

Resolved admin UI configuration with all defaults applied.

BaseField.admin


defaultValue: Record<string, unknown>

Defined in: packages/core/src/fields/keyValue/types.ts:138

Pre-filled value shown in the admin form when creating a new field. Does not apply to database values

BaseField.defaultValue


optional dependsOn?: readonly string[]

Defined in: packages/core/src/fields/baseTypes.ts:663

Other fields whose change re-runs this field’s validate() on a partial write.

BaseFieldInput.dependsOn

BaseField.dependsOn


optional description?: string

Defined in: packages/core/src/fields/baseTypes.ts:651

Semantic description of the field. Used in three places:

  1. Helper text rendered below the field input in the admin form UI.
  2. As the Zod .meta({ description }) value for form validation.
  3. As the JSDoc comment on the generated document interface property.

To write a separate JSDoc comment, use interfaceDescription in addition.

BaseField.description


optional index?: ResolvedFieldIndexConfigInput

Defined in: packages/core/src/fields/baseTypes.ts:655

Convex index name for this field, or the object form for a compound index.

BaseField.index


optional interfaceDescription?: string

Defined in: packages/core/src/fields/baseTypes.ts:653

The JSDoc comment on the generated document interface property

BaseField.interfaceDescription


interfaceType: string

Defined in: packages/core/src/fields/baseTypes.ts:657

TypeScript type string written to generated document interfaces (e.g. "string", "number", "string[]").

BaseField.interfaceType


optional keys?: KeyValueFieldKeysInput<TKeysSlug>

Defined in: packages/core/src/fields/keyValue/types.ts:135


label: string

Defined in: packages/core/src/fields/keyValue/types.ts:133

Display label shown in the admin form. Always set — inferred from the field key if not provided.

BaseField.label


meta: TFieldMeta

Defined in: packages/core/src/fields/baseTypes.ts:658

BaseField.meta


nullable: boolean

Defined in: packages/core/src/fields/baseTypes.ts:635

Whether null is a legal value for this field, in addition to its normal type.

BaseField.nullable


required: boolean

Defined in: packages/core/src/fields/keyValue/types.ts:134

Whether this field is required in the database schema.

BaseField.required


readonly type: "keyValue"

Defined in: packages/core/src/fields/keyValue/types.ts:130


value: AdminDataField

Defined in: packages/core/src/fields/keyValue/types.ts:137

The record’s own value field, with required forced to true.

optional validate(props): void | Promise<void>

Defined in: packages/core/src/fields/keyValue/types.ts:139

Server-only async validation, run after the generated Zod schema passes.

FieldValidateProps<TCollectionSlug, Record<string, unknown>>

void | Promise<void>

FieldValidate

BaseField.validate