Groupby not allowed for predicate of list type?

For predicate of list type, it seems that only the first item in the list can be grouped.

Groupby works only with edges. Not with lists.

Odd, what did you do?

kind: [int]

_:A kind “10” .
_:A kind “20” .
_:B kind “10” .

i want to get : {kind:10,count:2},{kind:20,count:1}
but only get: {kind:10,count:2}

If you need features for lists, you need to fill up an issue in Dgraph’s GitHub. With a good argument of doing it on DB side instead of your application side, examples of usage and so on. If it gets traction, surely it will have a good priority.

Ough, that’s a good hint. Still struggeling with @groupby :woozy_face:
In the sql world groupby and having are such nice tools to limit the results of multiple joins for what you want. In graphql± its seems to me, it’s either just limited or something completely different, laughing.
I’ll try it the next days to see, if I can get more used to it.

FYK we already support group by scalar feat(DQL): @groupby on scalar fields and count duplicate by minhaj-shakeel · Pull Request #7746 · dgraph-io/dgraph · GitHub

1 Like