Skip to main content

OneToMany

@webda/models


Type Alias: OneToMany<T, L, K>

OneToMany<T, L, K> = ModelRelated<T, L, K>

Defined in: packages/models/src/relations.ts:1150

Define a 1:n relation on the current model to another model

This is an helper type that allows to query the related objects with the correct type

T is the model to link to K is the attribute in T to query (not used but required to complete the graph)

Type Parameters​

T​

T extends Storable

L​

L extends Storable

K​

K extends Extract<FilterAttributes<T, ModelLinker<L>>, string> | ""