> ## Documentation Index
> Fetch the complete documentation index at: https://forest-chore-open-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Relationships

> Define and understand relationships between collections in your Forest schema

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`.

| 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]`                                                    |
