Search code examples
memgraphdb

How can I delete only some of the node properties using Cypher?


I have a node that has a lot of properties. I no longer need many of them. How can I delete the ones that I no longer need?


Solution

  • The REMOVE clause can be used to remove labels and properties both from nodes and relationships. Here is a simple query that does that:

    MATCH (n:WrongLabel) REMOVE n:WrongLabel, n.property;