Skip to content

Commit 31e6997

Browse files
Add example (set property to relationship) to SET page (#598) (#599)
1 parent 32cda33 commit 31e6997

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

modules/ROOT/pages/clauses/set.adoc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ CREATE
3838
[[set-set-a-property]]
3939
== Set a property
4040

41-
Use `SET` to set a property on a node or relationship:
41+
Update a node property:
4242

4343
.Query
4444
[source, cypher, indent=0]
@@ -59,6 +59,26 @@ The newly-changed node is returned by the query.
5959
Properties set: 1
6060
|===
6161

62+
Update a relationship property:
63+
64+
.Query
65+
[source, cypher, indent=0]
66+
----
67+
MATCH (n:Swedish {name: 'Andy'})-[r:KNOWS]->(m)
68+
SET r.since = 1999
69+
RETURN r, m.name AS friend
70+
----
71+
72+
.Result
73+
[role="queryresult",options="header,footer",cols="2*<m"]
74+
|===
75+
| r | friend
76+
| [:KNOWS {since: 1999}] | "Peter"
77+
2+d|Rows: 1 +
78+
Properties set: 1
79+
|===
80+
81+
6282
It is possible to set a property on a node or relationship using more complex expressions.
6383
For instance, in contrast to specifying the node directly, the following query shows how to set a property for a node selected by an expression:
6484

0 commit comments

Comments
 (0)