I saved the double (-0.1643) as a string ("-0.1643") in the neo4j property.
If I try to filter this value using a numerical comparison:
MATCH (n1:Node)-[r:RELATION]-(n2:Node) WHERE r.number < -0.1 RETURN n1, n2
Cypher gives an error message:
Don't know how to compare that. Left: "-0.1643" (String); Right: -0.1 (Double) Neo.ClientError.Statement.InvalidSyntax
Obviously, I could store the data as a numeric value. But is it possible to convert a string to double in cypher? Something like:
MATCH (n1:Node)-[r:RELATION]-(n2:Node) WHERE as.double(r.number) < -0.1 RETURN n1, n2
neo4j cypher
Martin preusse
source share