cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Neo4j Bloom Invalid Parameter input for LIMIT

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
7 REPLIES 7

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)

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.

Which version of Neo4j and which version of Bloom?

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)

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

This should be fixed in Bloom 1.3.1 that released today.

Neo4j Desktop version 1.2.7
Neo4j Enterprise for Developers 4.0.4