Skip to main content
A join is used to combine rows from two or more tables, based on a related column between them.

Declaration

In Forest, relations are defined as fields and are traversable in only one direction.

Join types

Four join types are available: ManyToOne, ManyToMany, OneToMany, and OneToOne.
TypeWhere are the common keys?
ManyToOneorigin[foreignKey] == foreign[foreignKeyTarget]
OneToManyorigin[originKeyTarget] == foreign[originKey]
ManyToManyorigin[originKeyTarget] == through[originKey] && though[foreignKey] == foreign[foreignKeyTarget]
OneToOneorigin[originKeyTarget] == foreign[originKey]