I have a neo4j db with the following:
a:Foo b:Bar
about 10% db have (a) - [: has] β (b)
I need to get only nodes that DO NOT have this relationship!
earlier doing () - [r?] - () would be great! however it is no longer supported :( instead, doing as they suggest "ADDITIONAL MATCH (a: Foo) - [r: has] β (b: Bar) WHERE b - NULL RETURN a" gives me a null result, since optional match requires that the BOTH nodes are either there or the BOTH nodes are not there ...
So, how can I get all the "a: Foo" nodes that are NOT bound to "b: Bar"?
Note. A dataset is millions of nodes, so a query must be efficient or it will expire otherwise.
Thank!
database neo4j cypher
Diaspar Sep 04 '14 at 19:04 2014-09-04 19:04
source share