Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Cypher
  • Table Of Contents Toc
Learning Cypher

Learning Cypher

By : Onofrio Panzarino
3.7 (12)
close
close
Learning Cypher

Learning Cypher

3.7 (12)
By: Onofrio Panzarino

Overview of this book

Table of Contents (13 chapters)
close
close

Deleting data


Cypher provides two clauses to delete data. They are as follows:

  • REMOVE: This clause is used to remove labels and properties from nodes or relationships

  • DELETE: This clause is used to delete nodes and relationships from the database

Removing labels

To remove a label from a node, you must use the REMOVE clause. The syntax is similar to the one for the SET clause, as shown in the following query:

MERGE (b:User {name: "Jack", surname: "Smith"})
REMOVE b:Inactive:MustConfirmEmail

This query removes the labels Inactive and MustConfirmEmail from the node that was matched. Note that we have chained the labels using the colon separator. If the node already doesn't have one or all of the labels specified, this query will not fail; it will only remove the labels it can remove.

Removing properties

The REMOVE clause is the opposite of the SET clause. It can be used to remove a property from a node, as shown in the following query:

MERGE (b:User {name: "Jack", surname: "Smith"})
REMOVE b.age

Anyway...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Cypher
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon