title: Neo4j/Cypher: Convert string to double
body: <p>I have stored a double (-0.1643) as string ("-0.1643") in a property on a neo4j relationship.</p>
  
  <p>If I try to filter on this value with a numeric comparison: </p>
  
  <pre><code>MATCH (n1:Node)-[r:RELATION]-(n2:Node)
  WHERE r.number &lt; -0.1 RETURN n1, n2
  </code></pre>
  
  <p>Cypher throws an error:</p>
  
  <pre><code>Don't know how to compare that. Left: "-0.1643" (String); Right: -0.1 (Double)
  Neo.ClientError.Statement.InvalidSyntax
  </code></pre>
  
  <p>Obviously, I could store the data as a numeric value. But is it possible to convert the string to double in cypher? Something like:</p>
  
  <pre><code>MATCH (n1:Node)-[r:RELATION]-(n2:Node)
  WHERE as.double(r.number) &lt; -0.1 RETURN n1, n2
  </code></pre>