cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Repository delete method

Does the Spring repository delete method work like the Cypher detach delete? In other words if I delete an Entity using

myEntityRepository.delete(myEntity);

will that delete all relationships with myEntity?

or do I need to write a @Query MATCH(...) that does the detach delete

Thanks!

2 REPLIES 2

The delete(entity) method will create a delete statement that does about the same and looks like MATCH (n) WHERE ID(n) = $id OPTIONAL MATCH (n)-[r0]-() DELETE r0, n.

Excellent! Thanks Gerrit