realm-js
realm-js copied to clipboard
Distinct / group by support?
It would be very useful to have.
I vote
+1
@alazier, is there any workaround available for distinct and group by support in realm js
also support this idea and am curious if there are workarounds available
At the moment the only way to achieve this is to pull all your data and use something like lodash to accomplish it I'm afraid.
Fair enough, thanks for the quick answer. In general, is there any way to see and upvote the realm-js roadmap beyond github issues?
Not at the moment, no. However, we do monitor GitHub as it's what we use for our internal project planning so we do take notice when people comment in here.
I see—thanks for clarifying!
+1
+1
+1
+1
+1
+1
+1
Is this supposed to be supported 2.3.x? Per the current documentation page:
Sorting and find distinct values are possible with functions SORT
and DISTINCT
, e.g. age > 20 SORT(name ASC, age DESC) DISTINCT(name)
.
I have tried to use these functions without success. I also have an open question on StackOverflow that is still unanswered.
Yes, this seems to work well with a predicate followed by sort and distinct.
I even made it work with a relation: time != null SORT(activity.id ASC, time DESC) DISTINCT(activity)