title: Can I count the number of nodes that are connected to other nodes via specific paths?
body: <p>Hi I have <code>Post</code> nodes and there can be replies to these <code>Post</code>s via <code>REPLY_TO</code> relationships.</p>
  <p>Like this:
  <code>MATCH (p2:Post)-[r:REPLY_TO]-&gt;(p:Post)</code></p>
  <p>What I'm trying to do is calculate how many total replies there are, and currently the max depth for this is 4 nested replies and there can be many replies to the same post, e.g:</p>
  <p><code>Post5 -[]-&gt; Post4 -[]-&gt; Post3 -[]-&gt; Post2 -[]-&gt; Post1</code></p>
  <p><code>Post7 -[]-&gt; Post6 -[]-&gt; Post2 -[]-&gt; Post1</code></p>
  <p><code>Post8 -[]-&gt; Post1</code></p>
  <p>I can't figure out how to count All posts that are replies to one post. Any idea? I started with this and tried changing <code>count</code> to <code>size</code> and using <code>collect</code>, I just cannot figure out what I need to be looking for here!</p>
  <pre><code>WITH collect(p2) as post2_count, p2
  MATCH (p3:Post)-[r3:REPLY_TO]-&gt;(p2)
  WITH collect(p3) as post3_count, p3, post2_count
  RETURN p2_count, count(post3_count)
  </code></pre>
  <p>The above is only 2 layers deep, but it didn't work there so I didn't expand to 4.</p>
  <p>Thank you in advance!</p>