Back

AppwriteException: Invalid query: Attribute not found in schema: accountId

  • 0
  • Databases
  • Auth
  • Apple
  • Web
Jonap2001
28 Apr, 2024, 22:39

videos and users

TL;DR
Developers are encountering an "Invalid query: Attribute not found in schema: accountId" exception when using Appwrite in their React Native project. The issue likely lies in the case sensitivity of attribute names. Check the attribute names and their consistency throughout the code. Also, ensure the correct version of Appwrite is being used.
Jonap2001
28 Apr, 2024, 22:39

and their attributes are

Jonap2001
28 Apr, 2024, 22:40

username which is a string email as email avatar as url accountid as a string

Jonap2001
28 Apr, 2024, 22:40

and they are all required

Ryan
28 Apr, 2024, 22:40

The attribute names are case-sensitive, might be worth trying [Query.equal('accountid', currentAccount.$id)]

Jonap2001
28 Apr, 2024, 22:41

Same issue :/

Jonap2001
28 Apr, 2024, 22:42

const currentUser = await databases.listDocuments( config.databaseId, config.userCollectionId, [Query.equal('accountid', currentAccount.$id)] )

Jonap2001
28 Apr, 2024, 22:43

I also went to version 13.0.2 and reinstalled, I am unsure why there is still an error

Ryan
28 Apr, 2024, 22:43

And the value of config.userCollectionId is the correct ID of that collection?

Jonap2001
28 Apr, 2024, 22:44

Yes, it was working before

Jonap2001
28 Apr, 2024, 22:45

I can double check the user id and etc

Jonap2001
28 Apr, 2024, 22:46

export const config = { endpoint: "https://cloud.appwrite.io/v1", ... userCollectionId: "662e7aac0022ad0bf674", }

Jonap2001
28 Apr, 2024, 22:46

id is the same and userCollectionId is consistent everywhere else

Ryan
28 Apr, 2024, 22:48

Which SDK are you using?

Jonap2001
28 Apr, 2024, 22:49

where can I check

Ryan
28 Apr, 2024, 22:49

It should be in package.json

Jonap2001
28 Apr, 2024, 22:49

"dependencies": { "appwrite": "^13.0.2", "expo": "~50.0.17",

Steven
28 Apr, 2024, 22:51

Would you please share either the JSON for the collection or a screenshot of the collection in the Appwrite console (including the url)?

Jonap2001
28 Apr, 2024, 22:52

Can you walk me through the steps just in case ?

Jonap2001
28 Apr, 2024, 22:52

please

Jonap2001
28 Apr, 2024, 22:53

do you want me to share the package.json file entirely ?

Steven
28 Apr, 2024, 22:54

No, in your browser's network logs there should be a request for the collections in your database. I'm asking for the response body that has the JSON

Jonap2001
28 Apr, 2024, 22:56

Where can I access network logs?

Steven
28 Apr, 2024, 22:57

Open your browser's dev tools

Jonap2001
28 Apr, 2024, 22:59
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