Cypher - get relationships with start node id, end node id and type

江枫思渺然 提交于 2019-12-25 07:20:05

问题


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.

I have tried this

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

But it doesn't work.

Solution

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.


回答1:


Works fine: http://console.neo4j.org/r/z9mb7r

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



来源:https://stackoverflow.com/questions/22853311/cypher-get-relationships-with-start-node-id-end-node-id-and-type

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