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
- there is critical problem in this part
when user update the integer and double both get error not update or upload
- Python function - error while creating /...
I have been trying to figure it out myself for the last 2 days. I have self-hosted appwrite instance, and I am running python 3.12 function. It works great up t...
- how can i make a relationship between a ...
i want to relate the $id from users auth table in appwrite with other column in my table user_profile. because is the same user... how can i have exactly the s...