CollectionConfigInput
Defined in: packages/core/src/collections/types.ts:249
Configuration input for a defineCollection() call.
A collection maps to a Convex database table. slug becomes the table name,
fields defines its shape, and labels controls how the collection appears
in the admin panel. Omitted labels are inferred from the slug.
Defaults applied by defineCollection():
{ labels: { singular: "Post", // title-cased from slug ("posts" → "Post") plural: "Posts", // title-cased + pluralised from slug }}Example
Section titled “Example”defineCollection({ slug: "posts", fields: { title: text({ required: true }), body: richtext(), },})- CollectionConfig for the resolved type after defaults are applied
- defineCollection for the config function
Type Parameters
Section titled “Type Parameters”TFieldMeta
Section titled “TFieldMeta”TFieldMeta extends object = { }
TCollectionMeta
Section titled “TCollectionMeta”TCollectionMeta extends object = { }
TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends string = string
TFieldSlug
Section titled “TFieldSlug”TFieldSlug extends string = string
TComponent
Section titled “TComponent”TComponent extends ComponentHKT = ComponentHKT
Properties
Section titled “Properties”admin?
Section titled “admin?”
optionaladmin?:AdminCollectionConfigInput<TFieldSlug,TComponent>
Defined in: packages/core/src/collections/types.ts:257
Admin panel behaviour for this collection. All properties are optional.
fields
Section titled “fields”fields:
Record<TFieldSlug,AdminField<TFieldMeta>>
Defined in: packages/core/src/collections/types.ts:271
Field definitions that make up this collection’s document shape.
indexes?
Section titled “indexes?”
optionalindexes?:object[]
Defined in: packages/core/src/collections/types.ts:275
Index definitions that create indexes on this collection in Convex.
fields
Section titled “fields”fields:
NoInfer<TFieldSlug>[]
name:
string
interfaceName?
Section titled “interfaceName?”
optionalinterfaceName?:string
Defined in: packages/core/src/collections/types.ts:273
Override the PascalCase interface name used in generated TypeScript types. Inferred from slug by defineCollection if omitted.
labels?
Section titled “labels?”
optionallabels?:object
Defined in: packages/core/src/collections/types.ts:264
Display names shown in the admin panel navigation and list views.
Both are inferred from slug if omitted.
plural?
Section titled “plural?”
optionalplural?:string
Plural display name (e.g. "Posts"). Inferred from slug if omitted.
singular?
Section titled “singular?”
optionalsingular?:string
Singular display name (e.g. "Post"). Inferred from slug if omitted.
optionalmeta?:TCollectionMeta
Defined in: packages/core/src/collections/types.ts:279
slug:
TCollectionSlug
Defined in: packages/core/src/collections/types.ts:259
Convex table name — used as the database table identifier and URL slug in the admin panel.