Hi, i can't manage to use listDocuments with node-appwrite. Documentation invites me to use Query.equal, but an error throws for invalid query. copilot insists that i use just array of strings, but all tries become invalid query errors.
what's is the right way to search in documents with node-appwrite 12 ?
here's my code :
const filters = [
`guildId==${guildId.toString()}`,
`slug=='${slug}'`
];
const giveaways = await databases.listDocuments(
appWriteConfig.databaseId,
appWriteConfig.giveawayCollection,
filters);
throw new Error(error.message);
^
Error: Invalid query: guildId==1205061903601369118
many thanks !
if i write :
const filters = [
Query.equal('guildId', guildId.toString()),
Query.equal('slug', slug)
];
const giveaways = await databases.listDocuments(
appWriteConfig.databaseId,
appWriteConfig.giveawayCollection,
filters);
i obtain : throw new Error(error.message); ^
Error: Invalid query: {"method":"equal","attribute":"guildId","values":["1205061903601369118"]} at Giveaway.retrieve (giveaway.js:69:15)
Recommended threads
- want to transfer My Project from One acc...
Hey Appwrite team I have one project which is now open source and I have used Appwrite Database and Storage service for my project because project is open sourc...
- Does AppWrite support SAML?
Firebase does. I was wondering if AppWrite does, since I can’t find it in the docs. Thanks! 🚀
- Chat App with Appwrite
Hey guys, I'm adding a chat feature to my app, to some extent alot of things is working work fine, but i have an issue i want to be able to check on the status ...