cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Finding none existing realtionships between nodes

I have two types of nodes that most often has a relation but not always. I would like to find the nodes that does not have a relation.

Something like:

MATCH (x:LABEL1 ) -[y:LABEL3]-> (z:LABEL2) WHERE y is not existing

1 ACCEPTED SOLUTION

You could write this:

MATCH (x:LABEL1 ) 
where not ((x)-[:LABEL3]->(:LABEL2))
RETURN x

View solution in original post

1 REPLY 1

You could write this:

MATCH (x:LABEL1 ) 
where not ((x)-[:LABEL3]->(:LABEL2))
RETURN x