Skip to content

CollectionRelation

CollectionRelation<TField, TTarget> = object

Defined in: packages/core/src/cms.ts:87

Defines the type of relationship between collections.

  • single: One-to-one relationship returning an Option of the target
  • array: One-to-many relationship returning an array of targets
  • map: Key-value mapping relationship returning a Map
const authorRelation: CollectionRelation<"authorId", "authors"> = {
type: "single",
field: "authorId",
target: "authors"
};

TField extends string = string

TTarget extends string = string

readonly field: TField

Defined in: packages/core/src/cms.ts:92


readonly target: TTarget

Defined in: packages/core/src/cms.ts:93


readonly type: "single" | "array" | "map"

Defined in: packages/core/src/cms.ts:91