O'Reilly logo

Building Web Applications with Python and Neo4j by Sumit Gupta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Transforming nodes and relationships

In this section, we will discuss updating labels, properties, and relationships.

Updating node properties

The properties of a node are modified by using the following Cypher statement:

MATCH (f:FEMALE {name: "Sheena"})
SET f.surname = "Foster"
return f;

The preceding statement will find the node Sheena and will add or update (if it already exists) the property surname with a new or modified value. For removing the property, just replace the SET statement in the preceding Cypher query with SET f.surname = NULL. We can also set multiple properties by separating them with a comma.

The REMOVE statement is another construct provided by Cypher for removing the properties of a node. For example, we can also execute the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required