A Clear DB solution for Neo4j 2.0 RC1

The old skool way (pre RC1) of wiping the database was:

//Clear DB
START n=node(*)
MATCH (n)-[r?]-() 
DELETE n, r

Which worked fine for M06 and previous, but, RC1 doesn’t allow optional relationships (using the ? operator) you’ll need to update to:

//Clear DB
START n=node(*)
OPTIONAL MATCH (n)-[r]-() 
DELETE n, r

Print | posted @ Thursday, November 28, 2013 3:48 PM

Comments on this entry:

No comments posted yet.

Post A Comment
Title:
Name:
Email:
Comment:
Verification: