type
Collection
Collection defines one document collection in authoring configuration.
Properties
| Property | Type | Description |
|---|---|---|
Slug | schema.CollectionSlug | Slug is the URL-safe collection name used by APIs, relationships, and the admin. |
Labels | CollectionLabels | Labels override the singular and plural names shown to authors. |
Admin | CollectionAdmin | Admin configures collection presentation and editorial organization. |
Fields | field.Fields | Fields owns the collection's immutable field shape, behavior, and presentation. |
Indexes | []CollectionIndex | Indexes defines ordered multi-field indexes. Unique indexes enforce tuple uniqueness while allowing multiple rows containing null. |
Auth | bool | Auth enables identities, passwords, and sessions for this collection. |
AuthConfig | AuthConfig | AuthConfig customizes behavior that applies when Auth is enabled. |
Upload | bool | Upload enables file metadata and storage behavior for this collection. |
UploadConfig | UploadConfig | UploadConfig customizes validation, privacy, and image variants for uploads. |
Versions | bool | Versions enables document revisions for this collection. |
Trash | bool | Trash keeps deleted documents recoverable until they are permanently deleted. |
LockDocuments | bool | LockDocuments coordinates exclusive document editing with timeout and takeover. |
DocumentLockConfig | DocumentLockConfig | DocumentLockConfig customizes lock expiry when LockDocuments is enabled. |
VersionConfig | VersionConfig | VersionConfig customizes drafts, retention, and autosave behavior. |
Access | CollectionAccess | Access defines collection-level authorization for each operation. |
Hooks | CollectionHooks | Hooks defines collection-wide lifecycle behavior. |
Endpoints | []Endpoint | Endpoints 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
}