title: Initiate and return node property if it does not exist using a single Cypher query
body: <p>I'm looking for a <strong>single</strong> Cypher query that will increment an integer node parameter and return the value while initiating it to <code>0</code> in case if it does not exist.</p>
  
  <p>Something like following pseudo-Cypher:</p>
  
  <pre><code>MATCH (n:Order)
  IF n.product_count IS NULL THEN n.product_count = 0 // this line is what I need
  SET n.product_count = n.product_count + 1
  RETURN n.product_count
  </code></pre>
  
  <p>I was able to put together a query with a <code>FOREACH</code> statement that gets the job done, but this seems hacky and not appropriate for my use case:</p>
  
  <pre><code>MATCH (n:Order)
  WHERE id(n) = 9503
  FOREACH ( i in (CASE WHEN n.product_count IS NULL THEN [1] ELSE [] END) | SET n.product_count = 0 )
  SET n.product_count = n.product_count + 1
  RETURN n.product_count; 
  </code></pre>
  
  <p>How would this be done the right way?</p>
  
  <p>Note: the <code>Order</code> node is very complex and contains many other properties, so <code>MERGE</code> statment in this case would be highly undesired.</p>