Cypher - get relationships with start node id, end

2019-08-27 19:31发布

问题:

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.



标签: neo4j nosql