type

Collection

type Collection struct { // Slug is the URL-safe collection name used by APIs, relationships, and the admin. Slug schema.CollectionSlug // Labels override the singular and plural names shown to authors. Labels CollectionLabels // Admin configures collection presentation and editorial organization. Admin CollectionAdmin // Fields defines the collection's stored values and admin presentation. Fields []field.Definition // Indexes defines ordered multi-field indexes. Unique indexes enforce tuple // uniqueness while allowing multiple rows containing null. Indexes []CollectionIndex // Auth enables identities, passwords, and sessions for this collection. Auth bool // AuthConfig customizes behavior that applies when Auth is enabled. AuthConfig AuthConfig // Upload enables file metadata and storage behavior for this collection. Upload bool // UploadConfig customizes validation, privacy, and image variants for uploads. UploadConfig UploadConfig // Versions enables document revisions for this collection. Versions bool // Trash keeps deleted documents recoverable until they are permanently deleted. Trash bool // LockDocuments coordinates exclusive document editing with timeout and takeover. LockDocuments bool // DocumentLockConfig customizes lock expiry when LockDocuments is enabled. DocumentLockConfig DocumentLockConfig // VersionConfig customizes drafts, retention, and autosave behavior. VersionConfig VersionConfig // Access defines collection-level authorization for each operation. Access CollectionAccess // FieldAccess maps field paths to field-level read and write authorization. FieldAccess map[string]FieldAccess // FieldHooks maps field paths to lifecycle hooks scoped to those values. FieldHooks map[string]CollectionHooks // Hooks defines collection-wide lifecycle behavior. Hooks CollectionHooks // Computed resolves virtual field values after an operation has produced a document. Computed map[string]Computed // Endpoints declares custom HTTP endpoints below // /api/collections/<slug>. They run before matching built-in collection // routes for the same method. Endpoints []Endpoint }

Executable authoring configuration for one document collection.

Source core/config.go:126

Slugschema.CollectionSlug
URL-safe identity used by APIs, relationships, and the admin.
LabelsCollectionLabels
Overrides singular and plural author-facing names.
AdminCollectionAdmin
Configures presentation and editorial organization.
Fields[]field.Definition
Declares stored values and admin presentation.
Indexes[]CollectionIndex
Declares ordered compound indexes.
Authbool
Enables identities, passwords, and sessions.
AuthConfigAuthConfig
Customizes behavior for an auth-enabled collection.
Uploadbool
Enables file metadata and object-storage behavior.
UploadConfigUploadConfig
Configures upload validation, privacy, and image variants.
Versionsbool
Enables document revision history.
Trashbool
Keeps deleted documents recoverable until permanent deletion.
LockDocumentsbool
Coordinates exclusive document editing.
DocumentLockConfigDocumentLockConfig
Customizes active lock expiry.
VersionConfigVersionConfig
Customizes drafts, retention, and autosave.
AccessCollectionAccess
Defines operation-level authorization.
FieldAccessmap[string]FieldAccess
Defines field-path read and write authorization.
FieldHooksmap[string]CollectionHooks
Defines lifecycle hooks scoped to field paths.
HooksCollectionHooks
Defines collection-wide lifecycle behavior.
Computedmap[string]Computed
Resolves virtual fields after an operation produces a document.
Endpoints[]Endpoint
Declares collection-scoped custom HTTP endpoints.