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
- Function running for more than 2 hours i...
This is my projectID: 669fe01b003800dd0503 Cloud functionID is 696ea05400147eb8eb3b I hope this doesn't count against my GB-hours?
- change role of a team member in Appwrite
It's not possible to add/change roles of a team meber in Appwrite Frontend. When you click on a member of a team you get forwarded to the configuration page of ...
- Session not found. Please run appwrite l...
I have encounter an issue with appwrite CLI They asking for a login session but in the doc, itโs mention that only setup client with endpoint / api key is enou...