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 targetarray: One-to-many relationship returning an array of targetsmap: Key-value mapping relationship returning a Map
Example
Section titled “Example”const authorRelation: CollectionRelation<"authorId", "authors"> = { type: "single", field: "authorId", target: "authors"};Type Parameters
Section titled “Type Parameters”TField
Section titled “TField”TField extends string = string
TTarget
Section titled “TTarget”TTarget extends string = string
Properties
Section titled “Properties”
readonlyfield:TField
Defined in: packages/core/src/cms.ts:92
target
Section titled “target”
readonlytarget:TTarget
Defined in: packages/core/src/cms.ts:93
readonlytype:"single"|"array"|"map"
Defined in: packages/core/src/cms.ts:91