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 → Create
AI-generatedOverview
This node interacts with the Appwrite API to create a new collection within a specified database. It is useful for automating the management of database collections, such as setting up new data structures for applications. For example, it can be used to programmatically create collections with specific permissions and security settings in an Appwrite database.
Use Case Examples
- Creating a new collection in a database with a unique ID and custom permissions.
- Enabling document-level security for a collection to restrict access at the document level.
Properties
| Name | Meaning |
|---|---|
| Database ID | The ID of the database where the collection will be created. |
| Collection ID | The ID of the collection to create. Can be set to unique() to generate a unique ID automatically. |
| Name | The name of 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 unique identifier of the created collection.name- The name of the created collection.permissions- The permissions set on the collection.documentSecurity- Indicates if document-level security is enabled.enabled- Indicates if the collection is enabled.
Dependencies
- Appwrite API endpoint
- Appwrite project ID
- Appwrite API key
Troubleshooting
- Ensure the provided database ID exists and is accessible with the given API key.
- Verify that the API key has sufficient permissions to create collections.
- Check that the collection ID is unique if manually specified, or use unique() to auto-generate.
- If document-level security is enabled, ensure permissions are correctly configured to avoid access issues.
Links
- Appwrite Database Collections Documentation - Official documentation for managing collections in Appwrite databases.