title: neo4j: set different properties based on existing properties
body: <p>I am trying to set new properties based on existing properties. The existing nodes have the following properties: </p>
  
  <p><code>minTempC</code>, <code>maxTempC</code></p>
  
  <p>New properties should be set if the following conditions are met:</p>
  
  <p><code>minTempC &lt; 0</code> set the property <code>frosstag = true</code></p>
  
  <p><code>maxTempC &lt; 0</code> set the property <code>eistag = true</code></p>
  
  <p><code>maxTempC &gt;= 30</code> set the property <code>heissertag = true</code></p>
  
  <p>The existing nodes can meet one, multiple or none of the conditions.</p>
  
  <p>My cypher right now is:</p>
  
  <pre><code>//Eistag
  MATCH (d:Data)
  WHERE d.maxtempC &lt; 0
  SET d += {eistag:true}
  
  //Frosttag
  MATCH (d:Data)
  WHERE d.mintempC &lt; 0 
  SET d += {frosttag:true}
  
  //Heisser Tag
  MATCH (d:Data)
  WHERE d.maxtempC &gt;= 30
  SET d += {heisserTag:true}
  </code></pre>
  
  <p>Is there a way to combine these three? I have several other properties that have to be set and writing these <code>SET</code> clauses over and over again seems a little bit tedious. I thought of using a <code>CASE</code>expression, but I am new to neo4j and must confess that I have no idea how to built such a expression.</p>
  
  <p>Thank you in advance for yout tips. </p>