Javatpoint Logo
Javatpoint Logo

Neo4j Delete a Relationship

Deleting relationship is as simple as deleting nodes. Use the MATCH statement to match the relationships you want to delete.

You can delete one or many relationships or all relationships by using one statement.


Delete the relationship named "PLAYER_OF" from the database:


Neo4j Delete a relationship 1

The above statement will match all Raul nodes that have a relationship type of PLAYER_OF with an Itly node.

Delete All Relationships related to a Node

There is a method to delete a node and all relationships related to that node.

Use the DETACH DELETE statement:



Neo4j Delete a relationship 2

This will delete the node "Kohli" where name is "Virat Kohli" with all its relationship.

Delete Whole Database

To delete all database use the DETACH DELETE statement without using a filter.

Next TopicNeo4j Read Clauses

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA