简体   繁体   English

Neo4j Cypher得到关系方向

[英]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找到外向关系

Unfortunately, that's not possible right now using Cypher. 不幸的是,现在使用Cypher是不可能的。 Here is an issue for it. 是一个问题。 Please add any comments you might have. 请添加您可能有的任何评论。

Andrés 安德烈斯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM