Reputation: 47881
If I wanted to do a "most liked" article query in neo 4j, where "liked" is a relationship between user and article, would the best way be to:
Or
I think I read in the documentation that queries cannot be sorted on total relationships count .
Upvotes: 0
Views: 261
Reputation: 33155
So, you can do:
start user=node(*)
match user-[rel:liked]->article
return count(rel) as likeCount, article
order by likeCount desc;
http://console.neo4j.org/r/5do0qr
Upvotes: 1