GT.
GT.

Reputation: 792

Neo4j Cypher - How to display graph of all nodes of a certain type with a common node?

ie all nodes that are attached to the node with the name "Immunodeficiency" and also attached to the node with the name "autosomal recessive"

I tried this:

MATCH (a)-[r*]->(b)
WHERE a.name="Immunodeficiency" AND b.name="autosomal recessive"
return a,r,b

But it's not working. It's just returning a and b without any relationships or nodes in between

Upvotes: 0

Views: 308

Answers (1)

Tomaž Bratanič
Tomaž Bratanič

Reputation: 6534

Try to return the paths

MATCH p=(a)-[r*]->(b)
WHERE a.name="Immunodeficiency" AND 
b.name="autosomal recessive"
return p

Upvotes: 1

Related Questions