You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/cypher/updating.adoc
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -269,19 +269,18 @@ RETURN j, r, m
269
269
270
270
The result is more duplication.
271
271
`MERGE` tries to match the *entire* pattern, and if it doesn't exist, it is created.
272
-
This happens because `MERGE` tries to find the information queried and, if it doesn't exist, it is then created.
273
272
274
273
Even though the graph already has Ann and Mark's nodes, the pattern `(Ann)-[:IS_FRIENDS_WITH]->(Mark)` doesn't exist, so all elements are created anew.
275
274
To avoid the duplication, you need to first `MATCH` the nodes and then create the relationship.
276
275
277
-
[IMPORTANT]
276
+
[NOTE]
278
277
====
279
278
If you created the previous duplication, you don't need to fix it before proceeding with the tutorial.
280
279
However, if you didn't do it, you need to create a new node for Mark, as it was removed in xref:cypher/updating.adoc#_delete_a_node_and_its_relationships[the previous step].
281
280
You can do it using either `CREATE` or `MERGE`.
282
281
====
283
282
284
-
In order to create the new relationship, without duplications, you need to first `MATCH` Ann and Mark's nodes:
283
+
In order to create the new relationship, without duplications, you need to first `MATCH` Ann and Mark's nodes and then `MERGE` (or `CREATE`) the relationship:
0 commit comments