Hierarchies

Declare one reference field as a model's hierarchy and its records form a tree, the way a site's pages sit under one another. Every read of a record then says where it sits.

One reference field makes the tree

Hierarchy is one of the relationship kinds a reference field can declare. Set the kind to hierarchy and that field becomes the model's tree edge, linking each record to the one above it.

Path and ancestors on every read

Two fields are added to every read of the model. path gives the record's place in the tree, for example /lookbook/japan-26, and ancestors gives the records above it.

Computed live, to 16 levels

Both fields are computed live on each read, by a walk up the tree that is capped at 16 levels.

Read the detail

The models guide has a hierarchy section showing the field declaration and the two fields a read returns.