@coasys/ad4m / Exports / RelationMetadataEntry
Interface: RelationMetadataEntry
Metadata stored for each relation via
Has Many
/
Has One
/
Belongs To One
/
Belongs To Many
Table of contents
Properties
Properties
filter
• Optional filter: boolean
Whether to auto-generate a conformance filter when target is set.
Defaults to true — set to false to opt out of DB-level type filtering
while keeping hydration capability via include.
Defined in
model/decorators.ts:44 (opens in a new tab)
getter
• Optional getter: string
Custom SurrealQL getter to resolve the relation values. The expression can reference 'Base' which will be replaced with the instance's base expression.
Defined in
model/decorators.ts:38 (opens in a new tab)
kind
• kind: "hasMany" | "hasOne" | "belongsToOne" | "belongsToMany"
Defined in
model/decorators.ts:27 (opens in a new tab)
local
• Optional local: boolean
Defined in
model/decorators.ts:33 (opens in a new tab)
maxCount
• Optional maxCount: number
Maximum number of related instances.
Set automatically: 1 for @HasOne/@BelongsToOne, undefined (unlimited) for *Many.
Defined in
model/decorators.ts:32 (opens in a new tab)
predicate
• predicate: string
Defined in
model/decorators.ts:24 (opens in a new tab)
target
• Optional target: () => Ad4mModelLike
Type declaration
▸ (): Ad4mModelLike
Target model class thunk. Optional for untyped string relations.
Returns
Defined in
model/decorators.ts:26 (opens in a new tab)
where
• Optional where: Where
Filter constraints on linked target nodes using the query DSL. Property names reference the target model's properties. Overrides auto-derived conformance when set.