October 2017
Beginner to intermediate
316 pages
8h
English
The logic is that to update one or more nodes, you need to MATCH them. Then, you set the new values of the properties that you want to update. Let's say that a year has passed. We need to update the ages of the Person nodes:
MATCH (n:Person{name:"Juliet"})WHERE n.age = 13SET n.age=14RETURN n ;
In a yearly batch, we can use the following query to update all the Person nodes:
MATCH (n:Person)SET n.age=n.age+1RETURN n ;
You will notice how fast it is on our little dataset. It did not take ages.
Add the Teen label to that Person nodes with an age greater than 12 and lower than 18:
MATCH (n:Person)WHERE n.age>=12 AND n.age <18SET n:TeenRETURN n ;
You can remove ...
Read now
Unlock full access