I am trying to find all the videos which 2 people commonly liked using the following cypher query
MATCH (p1: person)-[:LIKED]->(v)<-[:LIKED]-(p2: person)
return p1, p2, v
In the output each entry is listed twice, with the values of p1 and p2 being switched. Example:
BOB | Mary | Cat video
Mary| Bob | Cat video
How can such duplicate entries combined into one?