[Neo4j] Finding orphaned nodes...

2011-04-12 Thread Rick Bullotta
Is there any recommended technique for scanning a Neo database for orphaned nodes (e.g. nodes with no relationships)? ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user

Re: [Neo4j] Finding orphaned nodes...

2011-04-12 Thread Axel Morgner
Maybe slow, but easy and and working: for (Node n : graphDb.getAllNodes()) { if (!n.hasRelationship()) { n.delete(); } } On 12.04.2011 20:19, Rick Bullotta wrote: Is there any recommended technique for scanning a Neo

Re: [Neo4j] Finding orphaned nodes...

2011-04-12 Thread Michael Hunger
If you need more high performant variants of that, you can partition the node-id-space, read them in multiple threads and collect them in a concurrent queue for deletion, using a thread pool with a suitable transaction size for the parallel deletion. I think it is also possible to read the