简体   繁体   English

Neo4j按关系计数顺序

[英]Neo4j order by relationship count

I'm new to neo4j and tried to implement a graph with some success. 我是neo4j的新手,并尝试实现一些成功的图形。 Now I'm trying to make a query ordered by the number of relationships. 现在,我试图按关系数对查询进行排序。

For example. 例如。

START n=node(*) MATCH (n->[r]->()) ORDER BY Count(r)

is this the right syntax and how do I fire of this question in Java? 这是正确的语法吗,我该如何用Java激发这个问题?

The query can be like that 查询可以像这样

START n=node(*) MATCH n-[r]->()
 RETURN n, r, count(r) 
 ORDER BY count(r)

And you can simply use REST appi to fire the query and execute it in java code.. This link may help you Execute Cypher Queries from Java 而且,您可以简单地使用REST appi来触发查询并以Java代码执行它。此链接可以帮助您从Java执行密码查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM