neo4j - Order nodes by relationship count --> ThisShouldNotHappenError -
in neo4j database couple of nodes , relationships, trying find out "popular" users (in case: nodes participating in relationships):
start n=node:user('*:*') match (n)-[r]->(x) return n order count(r) desc limit 10
however, query (neo4j 1.9.2) results in following error:
thisshouldnothappenerror
developer: andres claims that: aggregations should not used this.
stacktrace: org.neo4j.cypher.internal.commands.expressions.aggregationexpression.apply(aggregationexpression.scala:31) org.neo4j.cypher.internal.commands.expressions.aggregationexpression.apply(aggregationexpression.scala:29) org.neo4j.cypher.internal.pipes.extractpipe$$anonfun$internalcreateresults$1$$anonfun$apply$1.apply(extractpipe.scala:47) org.neo4j.cypher.internal.pipes.extractpipe$$anonfun$internalcreateresults$1$$anonfun$apply$1.apply(extractpipe.scala:45) scala.collection.immutable.map$map1.foreach(map.scala:109) org.neo4j.cypher.internal.pipes.extractpipe$$anonfun$internalcreateresults$1.apply(extractpipe.scala:45) org.neo4j.cypher.internal.pipes.extractpipe$$anonfun$internalcreateresults$1.apply(extractpipe.scala:44) scala.collection.iterator$$anon$11.next(iterator.scala:328) org.neo4j.cypher.internal.pipes.toppipe.internalcreateresults(toppipe.scala:45) org.neo4j.cypher.internal.pipes.pipewithsource.createresults(pipe.scala:69) org.neo4j.cypher.internal.pipes.pipewithsource.createresults(pipe.scala:66) org.neo4j.cypher.internal.executionplan.executionplanimpl.org$neo4j$cypher$internal$executionplan$executionplanimpl$$preparestateandresult(executionplanimpl.scala:164) org.neo4j.cypher.internal.executionplan.executionplanimpl$$anonfun$getlazyreadonlyquery$1.apply(executionplanimpl.scala:139) org.neo4j.cypher.internal.executionplan.executionplanimpl$$anonfun$getlazyreadonlyquery$1.apply(executionplanimpl.scala:138) org.neo4j.cypher.internal.executionplan.executionplanimpl.execute(executionplanimpl.scala:38) org.neo4j.cypher.executionengine.execute(executionengine.scala:72) org.neo4j.cypher.executionengine.execute(executionengine.scala:76) org.neo4j.cypher.javacompat.executionengine.execute(executionengine.java:79) org.neo4j.server.rest.web.cypherservice.cypher(cypherservice.java:94) java.lang.reflect.method.invoke(method.java:611) org.neo4j.server.rest.security.securityfilter.dofilter(securityfilter.java:112)
any ideas on how can express differntly?
in terms of neo4j mannual, if need use aggregration in "order by", must include aggregration in "return", need add count(r) in "return" shown below,
start n=node:user('*:*') match (n)-[r]->(x) return n, count(r) order count(r) desc limit 10
Comments
Post a Comment