i am using the following query-
match p = (a:label1)-->(b:label2) return nodes(p)
its returning me results like this-
[{a1,b1},{a1,b2}, {a2,b3}, {a2,b4}]
but i need result in this form-
[{a1},{a2},{b1},{b2},{b3},{b4}]
i have rather very long path and...