title: Discarding the nodes we're collecting over
body: <p>We find writing and maintaining Cypher queries to be a bit pain when it comes to collecting items. We often want to collect something and discard the original node. See the following as an example:</p>
  
  <p><code>
  MATCH (p)-[]-(c)
  WITH p, collect(c) as c
  RETURN p, c
  </code></p>
  
  <p>The above doesn't look too bad. The problem is the explicit naming of <code>p</code>, the field we want to keep. As we add more <code>MATCH</code> and <code>OPTIONAL MATCH</code> with aggregation, this becomes a maintainability nightmare. We cannot reorder <code>MATCH</code>/<code>WITH</code> pairs without also changing all the fields we reference. When we do a <code>collect</code>, we always want to discard the original node.</p>
  
  <p><code>WITH</code> has an <code>*</code> that can be used, but this will include the field we're collecting, and we cannot replace the value.</p>
  
  <p><code>
  MATCH (p)-[]-(c)
  WITH *, collect(c) as c
  RETURN p, c
  </code></p>
  
  <p>Is there a way to exclude something in a <code>WITH</code> statement without explicitly naming everything that should be included?
  Something like the following?</p>
  
  <p><code>
  MATCH (p)-[]-(c)
  WITH *, without(c), collect(c) as cs
  RETURN p, cs
  </code></p>