Neo4j Cypher Get Relationship Direction

最后都变了- 提交于 2020-01-03 15:35:43

问题


I have following cypher query which returns all (in and out) relationships of an specific node:

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)" ?? :)

Thanks.


回答1:


Per neo4j 2.0, you can use startnode(r)

See http://docs.neo4j.org/chunked/snapshot/query-functions-scalar.html#functions-startnode

STARTNODE returns the starting node of a relationship

So in your example you might find outgoing relations by startnode(r) = s




回答2:


Unfortunately, that's not possible right now using Cypher. Here is an issue for it. Please add any comments you might have.

Andrés



来源:https://stackoverflow.com/questions/11393662/neo4j-cypher-get-relationship-direction

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