Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Relation → Update

AI-generated

Overview

This node updates a relation in a Directus collection. It is useful for modifying the metadata or configuration of a relation field that links collections in a Directus database. For example, you can update the relation's properties such as the related collection or the field that holds the related primary key.

Use Case Examples

  1. Updating the 'author' relation field in a 'books' collection to change its metadata.
  2. Modifying relation settings between 'articles' and 'categories' collections.

Properties

Name Meaning
Field Name The name of the field that holds the related primary key, matching the column name in the database.
Data (JSON) A partial JSON object representing the relation to update, allowing modification of relation properties.
Collection Name The unique name of the parent collection where the relation exists.

Output

JSON

  • relation - The updated relation object returned after the update operation.

Dependencies

  • Requires connection to a Directus API with appropriate authentication credentials.

Troubleshooting

  • Ensure the 'Field Name' matches an existing relational field in the specified collection.
  • The 'Data (JSON)' must be a valid partial relation object as per Directus relation schema.
  • Authentication errors may occur if API credentials are missing or invalid.

Links

Discussion