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
- Type 'Theme' does not satisfy the constr...
Type 'Theme' does not satisfy the constraint 'Row'. Type 'Theme' is missing the following properties from type 'Row': $id, $sequence, $tableId, $databaseId, a...
- Dev Keys not working
looks like dev key are broken they simply don't work i suggest remove them until you have them working otherwise they confuse devs took me few minutes trying ...
- Stuck migrating from supabase
Hello, I'm getting a 500 (Internal Server Error) when migrating from Supabase using the cloud console migration tool. Validation says error: "Couldn’t load reso...