Back

Error about non-existent attribute

  • 0
  • Self Hosted
  • Databases
  • Web
Ars
20 Apr, 2024, 19:44

Hello. I'm getting error below when trying to create a new document. I don't remember creating attribute "author", but it fits in the context of what I am doing. So it's possible that I added and then removed this attribute. Either way, it shouldn't exist by now, it doesn't show up in console as well. I attached the screenshots of console, error & my code.

TypeScript
Error: Invalid document structure: Missing required attribute "author"

My code:

TypeScript
await databases.createDocument("bible-assistant-db", "jwchat-threads", ID.unique(), {
      chatName: message,
      messages: [{
        role: "USER",
        content: [
          {
            type: "TEXT",
            text: message,
          },
          ...images.map((image: any) => {
            return {
              type: "IMAGE",
              media_type: image.media_type,
              data: image.data,
            };
          })
        ],
      }],
      isBusy: true
    }, [Permission.read(Role.user(user.$id))]);
TL;DR
Developers are receiving an error about a non-existent attribute "author" when trying to create a new document. Although the attribute isn't in the code or console, it may have been added and removed. The error persists.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more