Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Item → Delete Multiple

AI-generated

Overview

This node operation deletes multiple items from a specified collection in a Directus database. It is useful when you need to remove several records at once by providing their primary keys. For example, you can delete multiple articles or products by specifying their IDs in an array.

Use Case Examples

  1. Deleting multiple articles from the 'articles' collection by providing an array of article IDs to be deleted.
  2. Removing several user records from a 'users' collection by specifying their primary keys.

Properties

Name Meaning
Collection Name Specifies the unique name of the parent collection from which items will be deleted. This is a required field and the user selects from available collections.
Data (JSON) An array of item primary keys representing the items to be deleted. This is a required JSON input where the user provides the IDs of the items to delete.

Output

JSON

  • deletedCount - The number of items successfully deleted from the collection.
  • collection - The name of the collection from which items were deleted.

Dependencies

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

Troubleshooting

  • Ensure the collection name is correct and exists in the Directus instance.
  • Verify that the array of primary keys is valid and that the items exist in the collection.
  • Check API permissions to confirm the user has rights to delete items in the specified collection.
  • Common errors include invalid collection name, malformed JSON input for item IDs, or insufficient permissions.

Links

Discussion