
I'm getting the error:
AppwriteException: Invalid query: {"method":"equal","attribute":"accountId","values":["XXXXXXXXXXXXXXX"]}
I believe this is the errant code:
`export async function getAccount() { try { const currentAccount = await account.get();
TypeScript
return currentAccount;
} catch (error) {
console.log(error);
}
}
export async function getCurrentUser() { try { const currentAccount = await getAccount();
TypeScript
if(!currentAccount) throw Error;
const currentUser = await databases.listDocuments(
appwriteConfig.databaseId,
appwriteConfig.userCollectionId,
[Query.equal("accountId", currentAccount.$id)]
)
if (!currentUser) throw Error;
return currentUser.documents[0];
} catch (error) {
console.log(error);
}
}`
Thanks in advance for any assistance.
TL;DR
Issue: An AppwriteException is thrown with the error "Invalid query" in the app's code.
Solution: The error stems from the query in the `getCurrentUser` function where the accountId filter isn't being set correctly. Check the query parameters and ensure that the `accountId` filter is being passed correctly.Recommended threads
- My organization deleted, how??
Getting error mesasges and I can't find my organization.
- Attribute showing Processing
i extended my App & created Attribute it says Processing
- Error 404 - Collection not found
I tried to access a collection I have through the console. it exists in my collections list but when I enter it I get Error 404 - Collection not found. It happe...
