问题
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