title: incrementing a value in Neo4j cypher query
body: <p>A user is passing me an array of UUID that refer to nodes in my database. I want to related her USER node to each of these other nodes. The challenge is, I want to know the order in which the UUIDs were given to me.</p>
  
  <p>So if the UUIDs are: [AAA, CCC, BBB], I want to execute something like:</p>
  
  <pre><code>(user)-[:REL {order: 1}]-&gt;(:THING {name:"AAA"})
  (user)-[:REL {order: 2}]-&gt;(:THING {name:"CCC"})
  (user)-[:REL {order: 3}]-&gt;(:THING {name:"BBB"})
  </code></pre>
  
  <p>Of course, I don't want to do it in multiple statements. I want to pass that list as a parameter.</p>
  
  <pre><code>MATCH(u:USER {id:{id}})
  MATCH(t:THING) where t.name in {that_list}
  CREATE (u)-[:REL {order: ???}]-&gt;(t)
  </code></pre>
  
  <p>Note the <code>???</code>. That's the crux.</p>
  
  <p>How can this be accomplished? I have it passing tests using a loop, but I feel I ought to be able to do this.</p>