Relationships
Last updated
Last updated
This is the official documentation of the @forestadmin/agent
Node.js agent.
A join is used to combine rows from two or more tables, based on a related column between them.
In Forest Admin, relations are defined as fields and are traversable in only one direction.
Four join types are available: ManyToOne
, ManyToMany
, OneToMany
, and OneToOne
.
Type | Where are the common keys? |
---|---|
ManyToOne
origin[foreignKey] == foreign[foreignKeyTarget]
OneToMany
origin[originKeyTarget] == foreign[originKey]
ManyToMany
origin[originKeyTarget] == through[originKey] && though[foreignKey] == foreign[foreignKeyTarget]
OneToOne
origin[originKeyTarget] == foreign[originKey]