Appwrite icon

Appwrite

Interact with Appwrite API

Actions181

Collection → Create

AI-generated

Overview

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

  1. Creating a new collection in a database with a unique ID and custom permissions.
  2. 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

Discussion