
so i have document named "uploads" and "users" both are in one way relation so i want to assign the upload to a particular user help me in that pls

Let's say your users is like this
{
name: ""
uploads: {
upload_file: ""
}
}
Then you can do this
await databases.createDocument(
DB_ID,
COLLECTION_ID,
ID.unique(),
{
name: 'Spiderman',
uploads: [
{ upload_file: 'file'},
{ upload_file: 'file2'},
]
}
)

specially on this func types
async function CreateUpload(msgId: string, fileId: string, fileSize: string, botType: string) {
const promise = AppwriteDB.createDocument(
process.env.APPWRITE_DATABASE_ID! || "65d4e2cb945b18ce913c",
"65d4e325a9a679460393",
fileId,
{ msgId: msgId, fileId: fileId, fileSize: fileSize, name: msgId, botType: botType }
);
promise.then(
function (response) {
return response;
},
function (error) {
console.log(error);
}
);
}```

can you refer to this

I don't see relationship in your code

user is already created just i want that when the user will upload any file

What is the field of the user?

it will be in relation to it
Recommended threads
- Is my approach for deleting registered u...
A few weeks ago, I was advised not to use the registered users' id in my web app. Instead, I store the publicly viewable information such as username and email ...
- ❗[Help] Function stuck in "waiting" stat...
Hi Appwrite team 👋 I'm trying to contribute to Appwrite and followed the official setup instructions from the CONTRIBUTING.md guide to run the platform locall...
- Unable to create push providers - FCM or...
Currently unable to create a push provider for FCM or APNS.... https://github.com/appwrite/console/issues/2045 When uploading a file... FCM = Valid file retu...
