I have a neo4j db with the following:
a:Foo b:Bar
about 10% of db have (a)-[:has]->(b)
(a)-[:has]->(b)
I need to get only the nodes
This also works if you're looking for all singletons/orphans:
MATCH (a:Foo) WHERE not ((a)--()) RETURN a;
That would be
MATCH (a:Foo) WHERE not ((a)-[:has]->(:Bar)) RETURN a;