For the following query:
START n=node(1)
MATCH (n)-[:KNOWS]->(k), (n)-[:LOVES]->(l)
WITH collect(k) + collect(l) as friends, n
FOREACH(f in friends : create unique (n)-[:FRIEND]->(f))
(Data is as on console.neo4j.org) I expect that friends are Morpheus and Trinity so a new FRIEND relation is created from Neo to Morpheus and Neo to Trinity. However, on executing the query, there is only one relation created (Neo-[:FRIEND]->Morpheus). Execute the query again and the other relation is created (Neo-[:FRIEND]->Trinity)
Why is that? (Using Neo4j 1.8.2)