create_relation
Create many-to-one, one-to-many, or many-to-many relations between Directus collections by providing the collection, field, and related collection.
Instructions
Create a relation between collections (M2O, O2M, or M2M). For M2O: specify collection, field, and related_collection. For O2M: also include meta.one_field. Example M2O: {collection: "articles", field: "author", related_collection: "users"}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection | Yes | Many collection (the collection with the foreign key) | |
| field | Yes | Field name in the many collection | |
| related_collection | No | One collection (the related collection) | |
| meta | No | Relation metadata | |
| schema | No | Database relation configuration |