Actions181
- Account Actions
- Get Account
- Create Account
- Update Email
- Update Name
- Update Password
- Update Phone
- Update Status
- Get Preferences
- Update Preferences
- List Sessions
- Delete Sessions
- Get Session
- Update Session
- Delete Session
- Create Anonymous Session
- Create Email/Password Session
- Create Magic URL Session
- Create OAuth2 Session
- Create Phone Session
- Create Session from Token
- Create JWT
- Create Magic URL
- Create Phone Token
- Create Email Verification
- Update Email Verification
- Create Phone Verification
- Update Phone Verification
- Create Password Recovery
- Update Password Recovery
- Create Recovery
- Update Recovery
- Update MFA
- Create MFA Authenticator
- Update MFA Authenticator
- Delete MFA Authenticator
- Create MFA Challenge
- Update MFA Challenge
- Attribute Actions
- Avatars Actions
- Collection Actions
- Database Actions
- Document Actions
- Functions Actions
- Index Actions
- Locale Actions
- Messaging Actions
- Sites Actions
- Storage Actions
- Teams Actions
- Users Actions
Collection → Update
AI-generatedOverview
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
- Updating the name and permissions of a collection to reflect new access policies.
- Enabling document-level security on a collection to restrict document access based on user roles.
- 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
- Appwrite Documentation - Update Collection - Official documentation for updating collections in Appwrite's database service.