Find top nodes by most frequent in edges

Hi ,
I have user nodes and edges .
edges : follow, block , …
i want find users that most frequent in follow edges in other users .
that means find top nodes by follow edge.
can you help me to create this query ?

You can use Count Index https://docs.dgraph.io/query-language/#count-index

https://docs.dgraph.io/query-language/#count

{
  most_followers(func: gt(count(~follow), 1)) {
    uid
    name
    someOtherPred
  }
}
1 Like