I have the following Cypher Neo4J query, where I'm trying to find 3 nodes with a certain property and rename them:
MATCH (u:User{uid:"418938923891"}),
(ctx:Context{name:"seo_191220T1718"}), (ctx)-[:BY]->(u),
(ctxk:Context{name:"kwrds_191220T1718"}), (ctxk)-[:BY]->(u),
(ctxs:Context{name:"serp_191220T1718"}), (ctxs)-[:BY]->(u)
WITH DISTINCT ctx, ctxk, ctxs
SET ctx.name = "seo_storyn",
ctxk.name = "kwrds_storyn",
ctxs.name = "serp_storyn";
All works fine, however, when the query runs it says 24 properties changed, probably because the WITH
results are multiplied.
Is there a more elegant and efficient way to do that?