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

Add support for distinct for links #1906

Closed
chouex opened this issue Dec 8, 2015 · 10 comments
Closed

Add support for distinct for links #1906

chouex opened this issue Dec 8, 2015 · 10 comments

Comments

@chouex
Copy link

chouex commented Dec 8, 2015

i tried

realm.distinct(Parent.class, "Child");

throw java.lang.UnsupportedOperationException: The field must be indexed before distinct() can be used.
but linked field can not be indexed

and tried

realm.distinct(Parent.class, "Child.id");

throw java.lang.IllegalArgumentException: Field name 'Child.id' does not exist.

compile 'io.realm:realm-android:0.86.0'
android v4.4.4

@emanuelez
Copy link
Contributor

We currently do not support indexing (and consequently distinct) on links. I'll rename your issue and tag it as an enhancement request.

@emanuelez emanuelez changed the title Is Realm.distinct() support linking? Add support for indexing and distinct for links Dec 8, 2015
@CatalinPrata
Copy link

+1 I agree that this would be a very helpful feature! Thank you! :)

@cmelchior cmelchior added the Blocked This issue is blocked by another issue label Apr 14, 2016
@pradeep2929
Copy link

It will work
realmResult.distinct(CONTACT_ID);

@iamcrypticcoder
Copy link

+1 This feature will be very helpful and almost mandatory. Is there any alternative solution to this right now ? I really need a solution.

@Zhuinden
Copy link
Contributor

Zhuinden commented Mar 2, 2017

Wait, distinct across links is still not supported, even with Results integration?

@wilburx9
Copy link

Any workaround?

@Zhuinden
Copy link
Contributor

Zhuinden commented Aug 27, 2017

Invert your query so that it is not the distinct() that happens across the link.

@SuhasTS
Copy link

SuhasTS commented Feb 21, 2019

This would be a very useful feature.
How come sorting works across links and not distinct?

@cmelchior
Copy link
Contributor

Distinct on linked properties should be supported by Core now and there is an internal team needing this functionality, so we should look into lifting this restriction soon.

@cmelchior cmelchior removed the Blocked This issue is blocked by another issue label Jun 11, 2020
@cmelchior cmelchior changed the title Add support for indexing and distinct for links Add support for distinct for links Jun 11, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests