18

Using Match and Where can delete a relationship by ID.

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

Is there a simpler way?

Community
  • 1
  • 1
Rm558
  • 4,621
  • 3
  • 38
  • 43

3 Answers3

27

I use

MATCH ()-[r]-() WHERE id(r)=49 DELETE r
vladkras
  • 16,483
  • 4
  • 45
  • 55
8

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

start r=rel(id) delete r;
Michael Hunger
  • 41,339
  • 3
  • 57
  • 80
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
Rabbid76
  • 202,892
  • 27
  • 131
  • 174
ardan7779
  • 318
  • 3
  • 8