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
- Function deployment failed: Unable to re...
Hi Appwrite team, I have been experiencing persistent errors when i attempt to push my appwrite functions. The logs on the deployment detail page on the console...
- One to many 2 way, console UI not correc...
Hey, seems I'm facing the exactly same issue with this one: https://github.com/appwrite/appwrite/issues/6016 Since this Github issue stay open for so long, let ...
- Server Down
Appwrite services are down. When will they start working again?