java - Delete End Node to a relationship with neo4j cypher query -


i using spring neo4j , java. have @nodeentity on classes wish persist. in of these classes, have data members annotated @relatedto , @fetch. want able delete 1 of classes containing @nodeentity , delete data memembers connected vi @relatedto , @fetch annotations. have created delete query in attempt delete node , nodes connected via relations:

   @query("start n = node:uid(uid={0}) "         + "match n-[*]-x x match x-[r]-() "         + "delete x,r") public void deletebyuid(string uid); 

this deletes top level node , relations, leaves behind nodes connected via relationship top level node. how can modify query cypher?

you might want try

@query("start n = node:uid(uid={0}) "     + "match n-[*0..]-x x match x-[r]-() "     + "delete x,r") public void deletebyuid(string uid); 

since * defaulting [*1..].


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -