Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-07-2020 01:46 PM
Hello - I am trying to execute the query below with int parameter named $param (e.g. provide value 5), but getting the following error:
AN ERROR OCCURRED WHILE EXECUTING SEARCH:
LIMIT: Invalid input. '5.0' is not a valid value. Must be a non-negative integer.
Any thoughts why user input 5 is converted into 5.0 and caused the error? How to resolve?
MATCH (p:Player)-[r:SEASON]-(s:Season)
RETURN p,SUM(r.points)
ORDER BY SUM(r.points) DESC
LIMIT $param
05-07-2020 02:35 PM
When using the Javascript driver, floating points are used because Javascript doesn't support 64-bit integers.
You can try wrapping the limit in a toInteger() like so:
LIMIT toInteger($param)
05-07-2020 03:05 PM
Thanks Andrew. Already tried that, however, Bloom is not able to execute the query, just get stuck.
Side note: query works fine when I replace $param with actual number.
05-07-2020 03:58 PM
Which version of Neo4j and which version of Bloom?
05-07-2020 04:08 PM
Did you try to switch your input parameter to datatype integer? That works for me?
Otherwise you could try on an older bloom version to use LIMIT 0 + toInteger($param)
05-08-2020 12:07 AM
Yes, I did, still is not working. The query starts with execution but never ends, like an indefinite loop. When I change $param to constant (e.g. 5) in the query it works fine - so it's not about the query or graph data.
MATCH (p:Player)-[r:SEASON]-(s:Season)
RETURN p,SUM(r.points)
ORDER BY SUM(r.points) DESC
LIMIT 5
05-11-2020 09:07 PM
This should be fixed in Bloom 1.3.1 that released today.
05-08-2020 12:00 AM
Neo4j Desktop version 1.2.7
Neo4j Enterprise for Developers 4.0.4
All the sessions of the conference are now available online