Cypher-获取与起始节点ID,结束节点ID和类型的关系 [英] Cypher - get relationships with start node id, end node id and type

查看:599
本文介绍了Cypher-获取与起始节点ID,结束节点ID和类型的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我具有关系的开始和结束节点的类型和ID.

I have the type and the id for the start and end node of a relationship.

我想要一个返回所有可能动作的查询.

I would like a query that returns all the possible actions.

我已经尝试过

MATCH (a)-[r]-(b) WHERE id(a)=1 AND id(b)=2 RETURN *;

但是它不起作用.

解决方案

我使用GrapheneDB.通常,GrapheneDB在节点图形上显示系统节点ID,但是当您具有属性id时,它将显示它.当我运行查询时,我使用的是图形ID,实际上不是系统ID,因此id(a)没有给出预期的结果.

I use GrapheneDB. Usually GrapheneDB presents the system node id on the node graphic but when you have an attribute id it presents that instead. When I ran the query I was using the graphic id which wasn't actually the system id so id(a) didn't give the expected result.

推荐答案

工作正常: http://console .neo4j.org/r/z9mb7r

如您所见,如果连接了这两个节点,则返回一个结果.

As you can see, if these two nodes are connected, one result is returned.

这篇关于Cypher-获取与起始节点ID,结束节点ID和类型的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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