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
- Added Custom Domain - API requests with ...
I've added in a custom domain to Appwrite my domain itself is on cloudflare but has Appwrite name servers added and confirmed they work, I added the CAA in clou...
- Table contents missing (attributes+rows)
Here is an image of the cloud and the attributes that should exist Some of the table do have the data but others dont. I am able to access the rows via api c...
- Bug Report: type generation for enum of ...
### 👟 Reproduction steps in the enum element value, instead of English, use another language (Khmer), in my case Khmer text. ``` export enum ProvinceType { ...