title: Query intersection of Paths in Neo4j using Cypher
body: <p>Having this query working in Cypher (Neo4j):</p>
  
  <pre><code>MATCH p=(g:Node)-[:FOLLOWED_BY *2..2]-&gt;(g2:Node) 
  WHERE g.group=10 AND g2.group=10 
  RETURN p
  </code></pre>
  
  <p>which returns all possible paths belonging a specific group (group is just a property to classify nodes), I am struggling to get a query that returns the paths in common between both collection of paths. It would be something like this:</p>
  
  <pre><code>MATCH p=(g:Node)-[:FOLLOWED_BY *2..2]-&gt;(g2:Node) 
  WHERE g.group=10 AND g2.group=10
  MATCH p=(g3:Node)-[:FOLLOWED_BY *2..2]-&gt;(g4:Node) 
  WHERE g3.group=15 AND g4.group=15 
  RETURN INTERSECTION(path1, path2)
  </code></pre>
  
  <p>Of course I made that up. The goal is to get all the paths in common between both queries.</p>