Neo4j Cypher delete query
问题 I have a following Neo4j Cypher query for Decision entity deleting: MATCH (d:Decision) WHERE id(d) IN {decisionsIds} OPTIONAL MATCH (d)-[r]-(t) DELETE d, r WITH t, r WHERE NOT (id(t) IN {decisionsIds}) OPTIONAL MATCH (t)-[r2:VOTED_ON|:CREATED_BY|:VOTED_FOR]-() WHERE r2 <> r WITH t, r2 WHERE none(x in labels(t) WHERE x in ['User', 'Decision']) DELETE t, r2 Previously I had a Vote entity with relationships VOTED_ON and VOTED_FOR to entities Criterion and Decision . Also, Vote has relationship