Neo4j Cypher获取关系方向 [英] Neo4j Cypher Get Relationship Direction

查看:205
本文介绍了Neo4j Cypher获取关系方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下密码查询,该查询返回特定节点的所有(输入和输出)关系:

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, .......

现在,我想找出每种关系的方向.是否有类似"RETURN RelationshipDirection(r)"的命令? :)

Now I want to find out the direction of each relationship. Is there an command like "RETURN RelationshipDirection(r)" ?? :)

谢谢.

推荐答案

对于neo4j 2.0,您可以使用startnode(r)

Per neo4j 2.0, you can use startnode(r)

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

STARTNODE返回关系的起始节点

STARTNODE returns the starting node of a relationship

因此在您的示例中,您可能会发现startnode(r) = s

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

这篇关于Neo4j Cypher获取关系方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆