Realm-cocoa: Support queries involving arrays of primitives

Created on 23 Sep 2017  Â·  17Comments  Â·  Source: realm/realm-cocoa

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.

P-2-Expected T-Enhancement

Most helpful comment

This has now been implemented in Core and ObjectStore, awaiting implementation here.

All 17 comments

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")

This feature is quite crucial. Any updates?

Update ???

When we have updates, we'll post them in this issue.

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

Was this page helpful?
0 / 5 - 0 ratings