title: how to gather the unique related rows in a neo4j cypher query?
body: <p>I have 3 posts, 1 of which has two comments. I need to retrieve the 3 post plus the 2 comments and the authors. Problem is cypher returns all the associated links. How can I get only the rows I need? When run this query I get 72 rows....I am only expecting 4 rows:</p>
  <pre><code>MATCH (p:Posts)
  WITH p
  MATCH(c:Comments)-[r:COMMENTED_ON]-()
  WITH p, c 
  MATCH (u)-[:MADE_A_POST]-&gt;()
  WITH p,c,u
  MATCH (n)-[:POSTED_COMMENT]-() 
  RETURN {post:p,comments:c,author:u,commentator:n}
  </code></pre>
  <p>I am trying to ensure that each row only contain the properties related to that row. In this case I should have 4 rows...since one of the post has 2 comments. I looked at UNION, COLLECT and DISTINCT and none seems to be a good fit. Any help would be appreciated.</p>