i make small test like so
` import { Client, Databases, ID, RelationshipType } from "node-appwrite";
const client = new Client(); client .setEndpoint("https://cloud.appwrite.io/v1") .setProject("68.......") .setKey("standard_21ab........");
const databases = new Databases(client);
(async () => { const databaseId = "68...........";
const collection = await databases.createCollection(
databaseId,
ID.unique(),
"Test"
);
await databases.createStringAttribute(databaseId, collection.$id, "user_id", 36, true);
await databases.createRelationshipAttribute(databaseId, collection.$id, "user_id", "users", RelationshipType.OneToOne);
})(); `
The error message is
` throw new AppwriteException(data == null ? void 0 : data.message, response.status, data == null ? void 0 : data.type, responseText);
AppwriteException: Invalid type param: Value must be one of (oneToOne, manyToOne, manyToMany, oneToMany)
at _Client.call (file:///config/workspace/DCSLab/node_modules/node-appwrite/dist/client.mjs:293:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///config/workspace/DCSLab/test.js:23:5 {
code: 400,
type: 'general_argument_invalid',
response: '{"message":"Invalid type param: Value must be one of (oneToOne, manyToOne, manyToMany, oneToMany)","code":400,"type":"general_argument_invalid","version":"1.6.2"}'
}
`
i tried using string "oneToOne" also throwing same error
Recommended threads
- Appwrite Cloud project is paused and nev...
Hi Appwrite Team & Community, I am facing a problem with one of my Appwrite Cloud projects which seems to be identical to the other cases of "paused projects" ...
- Timed out waiting for runtime error
execution id 6a3e0791978712d81ee0 im having issue with appwrite function runtime performance. even after 4gbram and cpu same function sometimes completes in a...
- Project auto-blocked after load testing ...
Hi team 👋 My project has been automatically blocked with the message: "Project is currently blocked — Access to this project is restricted. Contact support if...