title: MERGE/CREATE in neo4j UNWIND
body: <p>I have following data <strong>(Info)</strong> in <strong>Neo4j Label</strong>:</p>
  
  <pre><code>{
     domain:"domain1.com",
     email: "some01@email.com"
  },
  {
     domain:"domain2.com",
     email: "some02@email.com"
  }
  ..................
  ..................
  </code></pre>
  
  <p>Now I want to insert data into <strong>Info</strong> if new domain is found, otherwise merge.</p>
  
  <p>I've tried the following <strong>CQL</strong>:</p>
  
  <pre><code> WITH [{domain:"domain1.com", email: "some@email.com"}, 
         {domain:"domain3.com", email: "some03@email.com"}] as arr
  
     UNWIND arr as ar
        MATCH (x:Info) WHERE x.domain = ar.domain
        WITH count(x) as c, ar
        CALL apoc.do.when( c &lt;&gt; 0, 
           'MERGE (a:Info {domain: ar.domain}) ON SET a.email=ar.email return a', 
           'CREATE (a:Info { domain: ar.domain, email: ar.email }) return a',
           { c:c, ar:arr }) YEILD value
         RETURN value
  </code></pre>
  
  <p>In above <code>CQL</code>, only merge is working, but nothing created.</p>
  
  <p>Any suggestion?</p>
  
  <p>Thanks in advance. </p>