Skip to content

FieldIndexInput

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

A field-level index in object form. The index covers this field first, then additionalFields in order:

author: relationship({ collection: users, index: { name: "by_author_status", additionalFields: ["status"] } })
// .index("by_author_status", ["author", "status"])

A field-level index wins over a collection-level indexes entry of the same name, as every field setting wins over its collection’s.

TCollectionSlug extends VexResourceSlug = VexResourceSlug

The owning collection, which types additionalFields.

TFieldKey extends string = never

This field’s own key, which additionalFields may not repeat.

optional additionalFields?: readonly Exclude<FieldKeyOfResource<TCollectionSlug>, TFieldKey>[]

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

Fields after this one, in index order. Omit for a single-field index.


optional draftStatus?: true | "both"

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

Also narrow this index on vex_status for draft/publish status composition. Requires the collection’s versions.drafts: true; defineCollection throws otherwise. Same true (replaces the index) / "both" (adds a vex_status-prefixed twin) contract as CollectionConfigInput.indexes[].draftStatus.


name: string

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

The Convex index name.