NotFoundException error for using Merge Nodes Apoc

Hi guys,

I was trying to merge some node groups into one node based on their label.
I looked at neo4j documentation (Merge Nodes - APOC Documentation) and tried to apply the query with my cases but it came up with this error.

1)


This is the graph I am working on and I set different colors to nodes based on thier labels.
What I am trying to do is to match the path which is consisted of nodes with same labels and merge them into one node for better visualization.

2)

MATCH (a:Stop)-[:HUWON]->(b:Stop)
WITH [a,b] as nodes
CALL apoc.refactor.mergeNodes(nodes,{properties:"combine", mergeRels:TRUE, produceSelfRel:FALSE})
YIELD node
RETURN count(*);

I wanted to merge nodes by matching specific paths(consisted of only ( :Stop) and [ :HUWON]) and enlist them but it show this certain errors.

I am not sure how this Apoc works but I can't just use
WITH Head(collect([a1,a2])) as nodes like an example from documentation because
then it will only merge the first path in the list due to head().

Can you help me with this? @dominic.teo

Thanks in advance!

Yejin

1 Like

Hi Yejin,

Did you managed to solve the issue?

Cheers,
Dominic