cypher query to get all relationship for a node doesn't return graphical representation in 3.1

[亡魂溺海] 提交于 2019-12-08 09:31:04

问题


I upgraded neo4j community edition from 3.0.3 to 3.1 and this query doesn't return graphical representation of all the relationships for this node anymore.

MATCH (:User {username: 'user6'})-[r]-()
RETURN r

Any reasons why it wouldn't work in 3.1?


回答1:


Looks like the browser requires you to return nodes in order to see the graphical view. Just add variables on your start and end nodes and return them.

MATCH (a:User {username: 'user6'})-[r]-(b)
RETURN r, a, b



回答2:


'r' refers to a relationship on its own. To return a graph you need the node(s) as well.

Try

MATCH graph = (a:User {username: 'user6'})-[r]-(b)
RETURN graph


来源:https://stackoverflow.com/questions/41971237/cypher-query-to-get-all-relationship-for-a-node-doesnt-return-graphical-represe

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!