
Is there a way to create a collection with the respective attributes?


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
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
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
- CORS errors with storage bucket
I have a javascript file in the storage bucket and I used the view endpoint in an `src` attribute of a `<script>` tag. But I am getting the `net::ERR_BLOCKED_BY...
- Oauth2-Error 400Invalid `success` param:...
My code: > await new Account(client).createOAuth2Session(OAuthProvider.Google, 'https://www.mydomain.online/home', 'https://www.mydomain.online'); I ha...
- Issue with `listDocuments` when using qu...
Hello, Appwrite team! I'm having an issue with `listDocuments` when using query modifiers: **Environment:** - Self-hosted Appwrite (`Version 1.4.13`) installe...
