
Is there a way to create a collection with the respective attributes?
TL;DR
The user wants to know how to create a collection with attributes using the Node.js Appwrite SDK. They mention that the provided examples only show how to create a collection without attributes. They speculate that creating string attributes might be involved and provide an example for creating a string attribute. They also mention that more information can be found in the documentation. The user asks if there is a way to create a collection with attributes.
Solution: The user can create a collection with attributes by utilizing the `createCollection` function and specifying the attributes using the appropriate methods (`createStringAttribute`, `createBooleanAttribute`, etc.) for each attribute type. While the

there are no examples how to create a collection with multiple attributes
for example the below examples shows how to create a collection, but not with attributes
TypeScript
const sdk = require('node-appwrite');
// Init SDK
const client = new sdk.Client();
const databases = new sdk.Databases(client);
client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;
const promise = databases.createCollection('[DATABASE_ID]', '[COLLECTION_ID]', '[NAME]');
promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
thou I understand that it has something to do with creating string attributes
TypeScript
const sdk = require('node-appwrite');
// Init SDK
const client = new sdk.Client();
const databases = new sdk.Databases(client);
client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;
const promise = databases.createStringAttribute('[DATABASE_ID]', '[COLLECTION_ID]', '', 1, false);
promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});

- create collection
- create attributs one by one
Recommended threads
- A feature/Fix request
Whenever I use Appwrite then to see the items of document I've to click "columns" option and select those items that I want to see then if I refresh browser/pa...
- Custom Domain TLS Certificate Not Applie...
Added a custom domain, but gives me an error ``` Requested host does not match any Subject Alternative Names (SANs) on TLS certificate [3d45f294eb3f84a3350132a2...
- 401 - Project is not accessible in this ...
This is on the app write console https://screen.aryanwadhera.tech/7YTVhLTf
