Hi Everyone,
I have a problem with connecting duplicate values together and create a Master/Child relationship. I was able to solve the issue when there is only one duplicate node for each original (master) record. When there are 2 or more duplicates, things get messy.
To make things simple, I have queried the following nodes:
I want Three OUT [MASTER_OF] relation to go from one node to the three other nodes
What I did until now is to identify the master node and I did it using the following:
MATCH (i:INTID{name:"575"})
MATCH (n:PERSON)-[]->(i)
WITH n ORDER BY n.overall DESC limit 1
RETURN n
Identify the children records:
MATCH (i:INTID{name:"575"})
MATCH (n:PERSON)-[]->(i)
WITH n ORDER BY n.overall DESC SKIP 1
RETURN n
But then I can't proceed from here.
I was thinking of trying to combining both queries in certain way. Using FOREACH
on the child records to iterate through the nodes and create a MASTER_OF relationship between master node and children node.