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
Attribute → Create Integer
AI-generatedOverview
This node interacts with the Appwrite API to create an integer attribute within a specified database and collection. It is useful for defining schema attributes that store integer values, with options to set constraints like minimum and maximum values, default values, and whether the attribute is required or an array. Practical applications include setting up structured data models in Appwrite databases for applications that require integer data fields, such as user age, product quantity, or rating scores.
Use Case Examples
- Creating an integer attribute 'age' in a user database collection to store user ages with a minimum value of 0 and a maximum of 120.
- Defining a required integer attribute 'quantity' in an inventory collection with a default value of 1.
- Setting up an integer array attribute 'scores' to store multiple integer values for game scores.
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 created. |
| Attribute Key | The key or name of the attribute to be created. |
| Required | Indicates whether the attribute is mandatory. |
| Default Value | The default integer value assigned to the attribute if no value is provided. |
| Array | Specifies if the attribute is an array of integers rather than a single integer. |
| Min | The minimum allowed value for the integer attribute. |
| Max | The maximum allowed value for the integer attribute. |
Output
JSON
id- The unique identifier of the created attribute.key- The key or name of the created attribute.type- The data type of the attribute, which is integer in this case.required- Indicates if the attribute is required.defaultValue- The default value set for the attribute.array- Indicates if the attribute is an array.min- The minimum value constraint for the attribute.max- The maximum value constraint for the attribute.
Dependencies
- Appwrite API key credential
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 'min' and 'max' values are valid numbers and that 'min' is not greater than 'max'.
- If the node throws an error about unknown resource or operation, confirm that the resource is set to 'Attribute' and operation to 'Create Integer'.
- Network or authentication errors may occur if the Appwrite endpoint, project ID, or API key are incorrect or expired.
Links
- Appwrite Database Attributes Documentation - Official documentation on managing database attributes in Appwrite.