title: Cypher Query Neo4j ForEach Merge return?
body: <p>So I'm trying to send a query that will Merge a number of nodes and I want the query to return the nodes that it created but I can't put the return statement inside the FOREACH so is there a way to collect the nodes and then return that collection at the end?</p>
  
  <pre><code>FOREACH (tagName in {tags} | 
  MERGE (n:items {classid:tagName.pClassid}) 
  ON CREATE 
  COLLECT(n) as allCreatedNodes) 
  RETURN allCreatedNodes;
  
  "params" : {
          "tags": [{"pClassid" : 1}, {"pClassid" : 2}, {"pClassid" : 3}]
           }
  </code></pre>