Trufaux
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
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Edit ID of an existing collection
Hi there. Is it possible to edit an ID of an existing collection? Right now it looks impossible from AppWrite cloud at least.
- Seed db
hello there... is this correct way to seed appwrite