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
- Relation Question
How do I create a relation from table y to an others x.$id. in my example I have a users table where I use Appwrites unique User IDs and I want other tables fo...
- Unknown attribute type: varchar / text
Since the `string` type is deprecated I tried using `varchar` and `text` in some newer tables, but when running `appwrite pull tables && appwrite types ./src/li...
- I'm experiencing a critical bug on Appwr...
Hey <@870607367597850624> team / support đź‘‹ I'm experiencing a critical bug on Appwrite Cloud that's blocking my production Flutter app. I've already filed GitH...