Rank 1: Thread
Since yesterday, I am getting this error : Error: Invalid document structure: Missing required attribute "bucketField" in my project with appwrite as the backend.
It was working fine till yesterday 1:00am IST. The code snippet where this error came from :
`const fileDocument = {
type: getFileType(bucketFile.name).type,
name: bucketFile.name,
url: constructFileUrl(bucketFile.$id),
extension: getFileType(bucketFile.name).extension,
size: bucketFile.sizeOriginal,
owner: ownerId,
accountId,
users: [],
bucketFileId: bucketFile.$id,
};
const newFile = await databases
.createDocument(
appwriteConfig.databaseId,
appwriteConfig.filesCollectionId,
ID.unique(),
fileDocument,
)
.catch(async (error: unknown) => {
await storage.deleteFile(appwriteConfig.bucketId, bucketFile.$id);
await handleError(error, "Failed to create file document");
});`
I have attached all the snapshots with the error and my appwrite collection -> attributes in this post.