title: FOREACH with collection in cypher
body: <p>I have a collection of rels,created using this </p>
  
  <pre><code>MATCH (u:user)-[i:INTEREST]-&gt;(t:term)
  WITH COLLECT([i,t]) AS its
  RETURN its
  </code></pre>
  
  <p>and it returns the array of rels and nodes correctly.
  see also <a href="http://console.neo4j.org/r/cw7saq" rel="nofollow">http://console.neo4j.org/r/cw7saq</a></p>
  
  <p>Now I want to set the properties of the relationship, but don't see how I can access the rels in the array. Tried this, </p>
  
  <pre><code>MATCH (u:user)-[i:INTEREST]-&gt;(t:term)
  WITH COLLECT([i,t]) AS its
  FOREACH (it IN its |
           SET it[0].testprop=89292" )
  </code></pre>
  
  <p>but it returns an error</p>
  
  <pre><code>Error: Invalid input '[': expected an identifier character, node labels, a property map, a relationship pattern, '(', '.' or '=' (line 4, column 16)
  "         SET it[0].testprop=89292" )"
  </code></pre>
  
  <p>anyone knows what is the right syntax to do this ? </p>