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 .
So, you can do:
start user=node(*)
match user-[rel:liked]->article
return count(rel) as likeCount, article
order by likeCount desc;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.