Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Relation → Delete

AI-generated

Overview

This node deletes a relation in a Directus collection. It is useful when you want to remove a relational link between collections in a Directus database, such as deleting a foreign key relationship or a related field entry. For example, if you have a 'books' collection with an 'author' field that relates to an 'authors' collection, this node can delete that relation.

Use Case Examples

  1. Deleting a relation between 'books' and 'authors' collections by specifying the collection name 'books' and the relational field 'author'.
  2. Removing a relational field from a collection to clean up database schema or update relationships.

Properties

Name Meaning
Collection Name Unique name of the parent collection where the relation exists. This is required to identify which collection's relation is to be deleted.
Field Name Name of the field that holds the related primary key in the collection. This matches the column name in the database and specifies which relation to delete.

Output

JSON

  • success - Indicates whether the relation deletion was successful.

Dependencies

  • Requires connection to a Directus API instance with appropriate permissions to delete relations.

Troubleshooting

  • Ensure the collection name and field name are correctly specified and exist in the Directus instance.
  • Check API permissions to confirm the user has rights to delete relations.
  • Common errors include 'Relation not found' if the specified field does not exist or 'Permission denied' if the API credentials lack delete rights.

Links

Discussion