type

Collection

Collection defines one document collection in authoring configuration.

Properties

PropertyTypeDescription
Slugschema.CollectionSlugSlug is the URL-safe collection name used by APIs, relationships, and the admin.
LabelsCollectionLabelsLabels override the singular and plural names shown to authors.
AdminCollectionAdminAdmin configures collection presentation and editorial organization.
Fieldsfield.FieldsFields owns the collection's immutable field shape, behavior, and presentation.
Indexes[]CollectionIndexIndexes defines ordered multi-field indexes. Unique indexes enforce tuple uniqueness while allowing multiple rows containing null.
AuthboolAuth enables identities, passwords, and sessions for this collection.
AuthConfigAuthConfigAuthConfig customizes behavior that applies when Auth is enabled.
UploadboolUpload enables file metadata and storage behavior for this collection.
UploadConfigUploadConfigUploadConfig customizes validation, privacy, and image variants for uploads.
VersionsboolVersions enables document revisions for this collection.
TrashboolTrash keeps deleted documents recoverable until they are permanently deleted.
LockDocumentsboolLockDocuments coordinates exclusive document editing with timeout and takeover.
DocumentLockConfigDocumentLockConfigDocumentLockConfig customizes lock expiry when LockDocuments is enabled.
VersionConfigVersionConfigVersionConfig customizes drafts, retention, and autosave behavior.
AccessCollectionAccessAccess defines collection-level authorization for each operation.
HooksCollectionHooksHooks defines collection-wide lifecycle behavior.
Endpoints[]EndpointEndpoints declares custom HTTP endpoints below /api/collections/<slug>. They run before matching built-in collection routes for the same method.

Full signature

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 owns the collection's immutable field shape, behavior, and presentation. Fields field.Fields // 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 // Hooks defines collection-wide lifecycle behavior. Hooks CollectionHooks // Endpoints declares custom HTTP endpoints below // /api/collections/<slug>. They run before matching built-in collection // routes for the same method. Endpoints []Endpoint }

Source core/config.go:132