SET is similar to that in SQL. It allows updating properties of node or relationship records (possibly NULL).
We will use the example database for demonstration, whose schema and data import commands are given here.
Set Node Properties
Set Single Label Node Properties
The following query sets the age property of the User node with name Adam to 50 (which is 30 in the original database).
Similarly the following sets Adam’s age property to NULL.
Query:
Set Multi Label Node Properties
Kùzu also supports updating node properties with multi-label nodes.
Note that node tabel “User” doesn’t contain the “population” property, thus tuples belonging to “User” table are ignored (reamining as NULLs) during Set operations.
Set Relationship Properties
Set Single Label Relationship Properties
The following query sets the since property of the Follows relationship(From Adam to Karissa) to 2012 (which is 2020 in the original database).