[英]Neo4j Cypher Get Relationship Direction
I have following cypher query which returns all (in and out) relationships of an specific node: 我有以下cypher查询,它返回特定节点的所有(in和out)关系:
START s=node(1) MATCH s<-[r]->(t) RETURN type(r) as RelationshipType, .......
Now I want to find out the direction of each relationship. 现在我想找出每个关系的方向。 Is there an command like "
RETURN RelationshipDirection(r)
" ?? 有没有像“
RETURN RelationshipDirection(r)
”这样的命令? :) :)
Thanks. 谢谢。
Per neo4j 2.0, you can use startnode(r) 根据neo4j 2.0,你可以使用startnode(r)
See http://docs.neo4j.org/chunked/snapshot/query-functions-scalar.html#functions-startnode 见http://docs.neo4j.org/chunked/snapshot/query-functions-scalar.html#functions-startnode
STARTNODE returns the starting node of a relationship STARTNODE返回关系的起始节点
So in your example you might find outgoing relations by startnode(r) = s
因此,在您的示例中,您可以通过
startnode(r) = s
找到外向关系
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.