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 Float
AI-generatedOverview
This node interacts with the Appwrite API to create a float attribute within a specified database and collection. It is useful for defining schema attributes that store floating-point numbers, with options to set constraints like minimum and maximum values, default values, and whether the attribute is required or an array. Practical applications include managing data schemas for applications that require precise numeric data storage, such as financial or scientific data.
Use Case Examples
- Creating a float attribute named 'price' in a product database collection, with a minimum value of 0 and a maximum value of 10000, to ensure valid pricing data.
- Defining a float attribute 'temperature' in a weather data collection, allowing an array of values to store multiple temperature readings.
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 value assigned to the attribute if no value is provided. |
| Array | Specifies if the attribute is an array of float values. |
| Min | The minimum allowed value for the float attribute. |
| Max | The maximum allowed value for the float attribute. |
Output
JSON
attributeId- The unique identifier of the created float attribute.key- The key or name of the created attribute.type- The data type of the attribute, which is float.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 for authentication
Troubleshooting
- Ensure the provided databaseId and collectionId 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 attribute key already exists in the collection schema, the operation may fail; use a unique key.
Links
- Appwrite Database Attributes Documentation - Official documentation on managing database attributes in Appwrite.