title: Using MERGE / CREATE UNIQUE
body: <p>I'm trying to create a unique node if it doesn't exist and connect it to another node if there is no relation.</p>
  
  <p>In this example I want to get or create a Year node for the year 2001. If there already is a 2001 node, I want to create the relation [:YEAR] from calendar if it does not exist, if there is no 2001 node, I want to create both the node and the relation. There is a single node of label Calendar in the db.</p>
  
  <pre><code>CREATE UNIQUE (calendar:Calendar)-[:YEAR]-&gt;(year:Year {number: 2001 }) RETURN year;
  
  MERGE (calendar:Calendar)-[:YEAR]-&gt;(year:Year {number: 2001 }) RETURN year;
  </code></pre>
  
  <p>When I try the queries I get "Unknown error"</p>
  
  <p>What does seem to work is to use one of these</p>
  
  <pre><code>MERGE (calendar:Calendar) CREATE UNIQUE (calendar)-[:YEAR]-&gt;(year:Year { number:2001} ) RETURN year;
  
  MERGE (calendar:Calendar) MERGE (calendar)-[:YEAR]-&gt;(year:Year { number:2001} ) RETURN year;
  </code></pre>
  
  <p>What is the difference between the last two queries, and why doesn't the first ones work?</p>