Hello
I am using cypher below to find name of nodes from A to B, and attach the id of path to them.
MATCH p = (n1:A)-[*]->(n2:B)
WHERE not(exists((n2)-[]->(:B)))
UNWIND nodes(p) AS n3
RETURN n1.name, n3.name, reduce(x = '0', y IN nodes(p) | x + '_' + id(y)) AS pid
I get output as table below, in which rows(in yellow) containing null value in n3.name column are not expected to be output.
n1.name
n3.name
pid
a010
null
0_10_1_2
a010
b001
0_10_1_2
a010
b002
0_10_1_2
a010
null
0_10_1_3
a010
b001
0_10_1_3
a010
b003
0_10_1_3
How can I exclude these rows from output?