-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug : Query an Array attribute with an array of values does not work #2838
Comments
Just tried using a fulltext index and it seems to work. Would it be the route to follow ? |
Fulltext option works great until I want to use multiple attributes in the fulltext index. Creating the inndex works in the console (no error) but when querying using this index an error is raised
|
Creating one single fulltext index for each attribute works though and I can query using a Search Query for each attributes defined in the index. |
how to implement search for matching document with array attribute which match and of the data in the list |
This is not really supported as of right now, every possible solution will come with its downsides 馃憤馃徎 We are working on a way to query the contents of an array. |
Is there any update on this issue ? I'm planing to have a tag search in an app so I search and found this thread. |
@meepeek, @superseby2, for this type of functionality, are you expecting for documents to return if they have any least one of the values in the query? For example, let's say the document has |
@stnguyen90 I think making the single param called exact match make more sense as we can overloaded the function for partial matching. I propose sample use cases and syntax representation as follow.
Also, tag use case will need distinct query so we will know all available tag list before the query. I didn't see query distinct in the doc but it can be temporary fixed by having a unique list updated as each record created or updated. However, I think distinct query should be available for every attribute types. |
Are there any news on this issue ? This would be very useful |
Hi, is there any news on this topic please ? Thanks |
I dont know if it is helpful, but i found out that you can use Query.search to looking for items in array. |
Any plans on implementing this? Using the search method for now, but feels a bit hacky. Thanks! |
This is a useless product. |
i have an attribute of type array and i want to update it by pushing value into, how can i do that in JS ?? |
Would also love this feature! Search is a hit or miss with foreign characters. |
That's exactly what I'm looking for |
Query.contains not available in node-appwrite 11.1.0 @stnguyen90 |
@oussamachah2020 here's an example to push into or add values to an array type attribute
|
@superseby2 I had a similar requirement and opted to retrieve the documents first and then filtered the results in my application code. |
For some reason this code also worked for querying the array attribute and suddenly stopped working
|
馃憻 Reproduction steps
I am trying to query a Collection where one attribute is an Array of string
Trying this syntax fails to retrieve anything (and it feels normal)
Trying this syntax fails also while it feels like it could work ;)
What I am trying to do is basically an "Array IN Array" comparison. Going the "equal" way seems hackish but I thought as the attribute is stored in a String it might work (and could be a work-around until a proprer "in" or "contains" operator exists. ?)
My only other option to make this work is use a function to "explode" the values contained in array_attribute in a new collection and then I can do a OR comparaison. It works but is not as straighforward + it generates a big collection.
馃憤 Expected behavior
some content is being retrieved
馃憥 Actual Behavior
Nothing is retrieved.
馃幉 Appwrite version
Version 0.12.x
馃捇 Operating system
Linux
馃П Your Environment
No response
馃憖 Have you spent some time to check if this issue has been raised before?
馃彚 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: