Cypher - get relationships with start node id, end

2019-08-27 18:46发布

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.

标签: neo4j nosql
1条回答
一夜七次
2楼-- · 2019-08-27 19:38

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

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

查看更多
登录 后发表回答