Appwrite icon

Appwrite

Interact with Appwrite API

Actions181

Attribute → Create DateTime

AI-generated

Overview

This node interacts with the Appwrite API to create a DateTime attribute within a specified database and collection. It is useful for automating the management of database schemas by programmatically adding DateTime attributes, which can be required or optional, have default values, and be defined as arrays if needed. Practical applications include setting up timestamp fields for records, scheduling data entries, or tracking event times in an Appwrite database.

Use Case Examples

  1. Creating a DateTime attribute named 'createdAt' in a user database to track record creation times.
  2. Adding a required DateTime attribute to an event collection to store event start times.

Properties

Name Meaning
Database ID The ID of the database where the attribute will be created.
Collection ID The ID of the collection within the database where the attribute will be added.
Attribute Key The key or name of the DateTime attribute to create.
Required Specifies whether the DateTime attribute is mandatory for records.
Default Value The default DateTime value assigned to the attribute if none is provided.
Array Indicates if the attribute should hold an array of DateTime values instead of a single value.

Output

JSON

  • attributeId - The unique identifier of the created DateTime attribute.
  • key - The key or name of the created attribute.
  • type - The data type of the attribute, which is DateTime.
  • required - Indicates if the attribute is required.
  • defaultValue - The default value set for the attribute.
  • array - Indicates if the attribute is an array.

Dependencies

  • Appwrite API
  • API key credential for authentication

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 create attributes in the specified database and collection.
  • Check that the attribute key is unique within the collection to avoid conflicts.
  • If the node throws authentication errors, confirm that the API key and project ID are correctly configured.

Links

Discussion