Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-29-2019 07:40 PM
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")
MATCH(A)-[r:PARENT_OF]-(b) RETURN *
Thanks!
04-29-2019 07:48 PM
That's pretty expensive if you don't bind (a) or (b) to specific nodes, but
MATCH
(a)-[r]-(b)
WHERE
type(r) <> 'PARENT_OF'
RETURN
a, type(r), b
04-30-2019 12:46 AM
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
04-30-2019 12:52 PM
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 (https://neo4j-contrib.github.io/neo4j-apoc-procedures/#commit-batching).
All the sessions of the conference are now available online