Okay, so I want to find all documents whose author field is contained in the enum passed in. Right now, I can only send a string value. I also found out that someone has reported a bug about it here: https://github.com/appwrite/appwrite/issues/3914.
Basically, Query.equal('author', 'yourRandomId') works. Query.equal('author', ['yourRandomId1', 'yourRandomId2', 'yourRandomId3']) doesn't.
im still not sure where enum fits in..
and what exactly is the error you're getting?
Enum is the array value, in this case ['yourRandomId1', 'yourRandomId2', 'yourRandomId3'].
Here's the error I'm getting:
message: 'Server Error',
code: 500,
type: 'general_unknown',
version: '0.10.28'
}```
is the attirbute an enum or a string?
The attribute is a string but I want to match it against an array of strings (enum).
Is that possible?
that's not an enum...that's just an array of strings
what's your project ID?
Technically, yes 😅 . I tend to use them interchangeably.
My project ID is 64796cdb64c159ad2827
Technically, yes 😅 . I tend to use them interchangeably.
Don't do that...it's very confusing to use a term incorrectly
Noted.
what exactly is your code?
Gimme a sec please
Query.equal('author', followedUsers),
Query.orderDesc('$createdAt')
]);```
can you print followedUsers before this line?
Right now, followedUsers is an empty array so the value is [].
so this will be fixed in the next version of Appwrite: https://github.com/appwrite/appwrite/issues/5522
For now, you should check if followedUsers is empty and only pass the query if followedUsers is not empty
Array value during search query
Array value during query
Oh, oh, oh. That's good to know. I had a feeling that might be the case.
Thanks a lot for your help & sorry again for tagging you (and for the earlier confusion) 🙏🏽 .
👍🏼 no worries!
[SOLVED] Array value during query
what a leader you are @Steven 😇
Recommended threads
- Do I need to upgrade my Appwrite plan?
So i am making a file hosting & sharing platform (voltzy.lol) and i am expecting approx 5-8 million visit per month and over 30 million uploads per month do i n...
- Need a web developer
Need. Web developer for a paid project/collaboration
- total parameter not working correctly in...
Hello Appwrite team, I'm experiencing issues with the total parameter in the listRows() method (TablesDB) across multiple SDKs. **Issue 1**: Node.js SDK (node...