⚠️ This lesson is retired and might contain outdated information.

Delete Nodes and Relationships in Neo4J with Cypher

Matt Ross
InstructorMatt Ross
Share this video with your friends

Social Share Links

Send Tweet
Published 5 years ago
Updated 2 years ago

Nothing lives forever, so we need to know how to use DELETE and DETACH to get rid of nodes and relationships we no longer want in our graph.

Instructor: [00:01] Removing nodes from Cypher is as simple as using MATCH to find the node and DELETE to remove it. If we're trying to delete a node with relationships however, we will need to instruct Neo4j to first detach that node's relationships and then delete the node. This will detach and delete all incoming and outgoing relationships for the node in question.

[00:23] We can also use DELETE to remove relationships connecting the nodes in our graph. We can see that Han is no longer related to Chewie through the "Has sidekick" relationship.

egghead
egghead
~ 19 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today