18

Using Match and Where can delete a relationship by ID.

Match ()-[r]-() Where ID(r)=1 Delete r

Is there a simpler way?

1
  • 3
    What's wrong with what you have?
    – Tony Ennis
    Commented Oct 28, 2015 at 15:20

3 Answers 3

29

I use

MATCH ()-[r]-() WHERE id(r)=49 DELETE r
8

Using the old syntax, but that will be removed in a future version.

start r=rel(id) delete r;
8

You can delete by simple modified chyper for delete some Relations.

This is my code:

MATCH ()-[r]->() WHERE id(r)=43 OR id(r)=44 OR id(r)=45 DELETE r

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.