using Neo4j - Graph Database Kernel 2.0.0-M02 and the new merge function, I was trying to merge nodes into a new one (merge does not really merges but binds to the returning identifier according to the documentation) and delete old nodes. I only care at the moment about properties to be transferred to the new node and not relationships. What I have at the moment is the cypher below
merge (n:User {form_id:123}) //I get the nodes with form_id=123 and label User
with n match p=n //subject to change to have the in a collection
create (x) //create a new node
foreach(n in nodes(p): set x=n) //properties of n copied over to x
return n,x
Problems 1. When foreach runs it creates a new x for every n 2. Moving properties from n to x is replacing all properties each time with the new n so if the 1st n node from merge has 2 properties a,b and the second c,d in the and after the set x=n all new nodes end up with c,d properties. I know is stated in the documentation so my question is: Is there a way to merge all properties of N number of nodes (and maybe relationships as well) in a new node with cypher only?