Appwrite icon

Appwrite

Interact with Appwrite API

Actions181

Collection → Update

AI-generated

Overview

This node updates a collection within a specified database in the Appwrite backend service. It allows users to modify collection properties such as the collection's name, permissions, document-level security settings, and whether the collection is enabled. This operation is useful for managing and maintaining collections dynamically in applications that rely on Appwrite for backend data storage and access control.

Use Case Examples

  1. Updating the name and permissions of a collection to reflect new access policies.
  2. Enabling document-level security on a collection to restrict document access based on user roles.
  3. Disabling a collection temporarily by setting its enabled status to false.

Properties

Name Meaning
Database ID The ID of the database containing the collection to update.
Collection ID The ID of the collection to update.
Name The new name to assign to the collection.
Permissions An array of permission strings defining access control for the collection.
Document Security Boolean flag to enable or disable document-level security for the collection.
Enabled Boolean flag to enable or disable the collection.

Output

JSON

  • collectionId - The ID of the updated collection.
  • databaseId - The ID of the database containing the updated collection.
  • name - The updated name of the collection.
  • permissions - The updated permissions array for the collection.
  • documentSecurity - The updated document-level security status.
  • enabled - The updated enabled status of the collection.

Dependencies

  • Appwrite API key credential for authentication and access to the Appwrite backend service.

Troubleshooting

  • Ensure the provided Database ID and Collection ID are correct and exist in the Appwrite project.
  • Verify that the API key credential has sufficient permissions to update collections.
  • Check the format of the permissions array to ensure it is valid JSON and follows Appwrite's permission string syntax.
  • If document-level security is enabled, ensure that the application logic supports this security model to avoid access issues.

Links

Discussion