Count number of repeating a node in follower of followers

Hi everyone
we write a recommender system that calculate how much a user related to followers of followers
i want to do something like this cypher query in dgraph
count number of repeating a node in follower of followers and sort the result by this value

MATCH (u:User {_key: $name})-[:FOLLOW]->(f)-[:FOLLOW]->(fof)
WHERE not((u)-[:FOLLOW]->(fof)) and not fof._key=$name RETURN fof._key as rec, COUNT(*) as c
ORDER BY c DESC SKIP $skip LIMIT $limit

and we query in dgraph is :

{
   find (func : allofterms(UrlName , "mhb8898")) {
   Follow{
     UrlName
       Follow{
       UrlName
     }
   }
 }

can you help us ?!
thanks.

I see that this issue was solved in https://dgraph.slack.com/archives/C13LH03RR/p1563887654165300?thread_ts=1563882746.163100&cid=C13LH03RR right?

1 Like

Hello
Yes, thank you so much :smiley:
This topic has been created before you answered .