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
- Cloud function deploy stucks in processi...
Been trying for the last hours to deploy my function but for whatever reason, alwasy stuck on processing!
- Increase by operators
I see appwrite have bunch of useful operators for querieng db. One more I would like to suggest is operators like increase the count of a int columns by 1,2.. ...
- One-time Cloud migration blocked by data...
Hi, Iโm blocked on a one-time migration from Appwrite Cloud to my self-hosted Appwrite instance. We already fixed the region issue, and the migration now corre...