We recently added support for arrays of primitives (#1120), but omitted support for queries on these properties due to time constraints. Queries involving these properties should be supported.
Any updates on filtering?
Hi Realm team, any news on filtering on list of primitives ?
any updates?
I use SUBQUERY() as a workaround.
Here is an example
class Conversation: Object { {
let messages = List<Message>()
@objc dynamic var participant: Account?
}
class Message: Object {
@objc dynamic var headline: String?
@objc dynamic var content: String?
@objc dynamic var sync_is_new: String?
}
Finding all conversation containing messages with sync_is_new == seen
realm.objects(Conversation.self).filter("SUBQUERY(messages, $message, $message.sync_is_new == %@).@count > 0", "seen")
That still doesn't solve filtering an array of primitives, see:
https://github.com/realm/realm-object-store/issues/513
https://github.com/realm/realm-cocoa/issues/5491
https://github.com/realm/realm-java/issues/5361
This feature is quite crucial. Any updates?
Update ???
When we have updates, we'll post them in this issue.
guys it's been over a year, it's rather awkward to tell people to map primitive lists into a single String next to the actual list of primitives just to support having a field that is at least queryable in some way
I think this should be P1
I think so too. "time constraints" made sense 1.5 years ago, but... :smile: https://github.com/realm/realm-object-store/issues/513
Anyways, maybe it'll happen.
Dear Realm team, if "Support queries involving arrays of primitives" is NOT on your current road map and is NOT planned to be implemented in observable future, please, inform your users here and in related threads, so we could refactor our code accordingly and remove all these TODO's in code declaring "rewrite this when Realm starts supporting queries involving arrays of primitives".
Hi Folks – Hoping to revisit a few of these long-standing items now that we have on our public roadmap up. This request is covered by "Support for Query Operators on Single-Typed Arrays" which is outlined in a phase of work spanning Jan 2020 through July 2020.
Separately, we're working to move feature requests to a new forum so I will add an item to cover this request and will use that for future updates.
This has now been implemented in Core and ObjectStore, awaiting implementation here.
Any update?
I need this so badly! Of course i can write a migration and convert all List<String> to something like List<MyRealmString> but it would be so stupid if i change my code base (iOS / Android), check all implications, migrate thousands of databases and two weeks later this feature is available.
Currently my apps just ignore this kind of filtering but the number of users complaining about that is increasing strongly!
Can you please provide a timeframe when this feature will be available? I need something i can say to my customers...
We are working on it now - hopefully within the next quarter or so
Most helpful comment
This has now been implemented in Core and ObjectStore, awaiting implementation here.