All relationship types EXCEPT....

Hey - I bit of a basic question but I can't seem to find an answer....

How do I return the opposite of this query? (i.e. all nodes related by any relationship type EXCEPT "PARENT_OF")



That's pretty expensive if you don't bind (a) or (b) to specific nodes, but

 type(r) <> 'PARENT_OF'
  a, type(r), b
1 Like

Thanks Ryan - MUCH appreciated!

Its only a one off query so I can set relationship weights depending on the node attributes. so I guess I'll have to sit & wait a while :slight_smile:

Cheers @michael.knee. You might want to look at apoc.periodic.iterate for large batch operations. Speeds things up quite a bit as the size of an individual transaction gets much smaller (

1 Like