Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support queries involving arrays of primitives #5334

Closed
bdash opened this issue Sep 23, 2017 · 17 comments · Fixed by #7056
Closed

Support queries involving arrays of primitives #5334

bdash opened this issue Sep 23, 2017 · 17 comments · Fixed by #7056
Assignees

Comments

@bdash
Copy link
Contributor

bdash commented Sep 23, 2017

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.

@a0g83agbc84
Copy link

Any updates on filtering?

@macfurin
Copy link

macfurin commented Aug 1, 2018

Hi Realm team, any news on filtering on list of primitives ?

@guhan0
Copy link

guhan0 commented Aug 27, 2018

any updates?

@tgoyne tgoyne removed their assignment Sep 5, 2018
@tristangrichard
Copy link

tristangrichard commented Oct 12, 2018

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

@basememara
Copy link

That still doesn't solve filtering an array of primitives, see:

https://github.com/realm/realm-object-store/issues/513
#5491
realm/realm-java#5361

@aritrobanerjee93
Copy link

This feature is quite crucial. Any updates?

@neil-degoo
Copy link

Update ???

@nirinchev
Copy link
Member

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

@Zhuinden
Copy link

Zhuinden commented May 6, 2019

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

@jessehao
Copy link

I think this should be P1

@Zhuinden
Copy link

Zhuinden commented May 31, 2019

I think so too. "time constraints" made sense 1.5 years ago, but... 😄 https://github.com/realm/realm-object-store/issues/513

Anyways, maybe it'll happen.

@belakva
Copy link

belakva commented Oct 21, 2019

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

@drewdipalma
Copy link

drewdipalma commented Oct 21, 2019

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.

@bmunkholm
Copy link
Contributor

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

@qazwini
Copy link

qazwini commented Sep 7, 2020

Any update?

@liefersfl
Copy link

liefersfl commented Oct 20, 2020

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...

@ianpward
Copy link

We are working on it now - hopefully within the next quarter or so

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.