Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neo4j - Unknown 'toFloat' function in Cypher

Tags:

neo4j

cypher

I'm trying to run a cypher query where I have to compare a value stored as a String, but when I use the function toFloat, I get an error :

Unknown function 'toFloat' (line 2, column 7)
"WHERE toFloat(r.acquiredValue) >= 100000"
       ^

I'm using Neo4j 2.0.1, and according to the Neo4j Cypher Refcard, the function exists, and even by looking at the source code of the community edition, I can find that the function is written.

Have you ever got this error ? How can I convert a string to float in a cypher query ? Thanks.

EDIT : Here is the query trying to run

MATCH (profile)<-[:HAS_PROFILE]-(c:Customer)-[r:HAS_PRODUCT]->(product)
WHERE toFloat(r.acquiredValue) >= 100000
RETURN c.customerId AS CustomerID, profile.code AS ProfileCode, product.name AS ProductName, r.acquiredValue AS AcquiredValue
ORDER BY r.acquiredValue DESC
like image 814
Mohamed Amine Avatar asked May 03 '26 04:05

Mohamed Amine


1 Answers

toInt and toFloat are not yet added in 2.0.1 release. Check at this link.{line 28} Its been planned to release with 2.0.2

like image 127
Sumeet Sharma Avatar answered May 05 '26 17:05

Sumeet Sharma



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!