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
- SELF HOSTING ISSUE, DATA NOT MIGRATING T...
Hey, devs, I recently tried to migrate my cloud instance to a self hosted version but my data is not transferred fully only the table structure is transferred ...
- unlike any other provider, your sites DN...
your nameservers dont work with a funny little CNAME error, which is a weird bug but thats what you get when you try to be the kitchen sink, funny errors.
- Weird Table Causes Console to break
I dont even know how this even happened looks like the $createdAt and , $id got switched? <@831428608895615056>