Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-04-2018 05:00 PM
Hi,
When I return numbers from a Cypher query, such as the number of followers of a node or the Count of a group of nodes, it returns it as { low: [the value is here], high: 0 }.
How can we avoid this? It makes it somewhat of a headache to extract the values from this object. Is there a reason it returns this low/high?
Solved! Go to Solution.
09-04-2018 05:16 PM
This is because numeric values in Neo4j are 64-bit, and some languages (such as javascript) can't adequately parse or represent this with the numeric data type, and the components here can be addressed using some helper code we've provided for the javascript driver (this may also be available for the drivers in other languages).
Here's the section of the Javascript driver docs describing the helper classes available for working with this return format.
09-04-2018 05:16 PM
This is because numeric values in Neo4j are 64-bit, and some languages (such as javascript) can't adequately parse or represent this with the numeric data type, and the components here can be addressed using some helper code we've provided for the javascript driver (this may also be available for the drivers in other languages).
Here's the section of the Javascript driver docs describing the helper classes available for working with this return format.
09-04-2018 05:19 PM
Note also that there's a new section on enabling native numbers that will do this conversion for you if you want a more automatic means of handling, though if working with numbers that can't be represented with Javascript's numeric type you may get incorrect results.
01-10-2022 01:31 AM
For anyone else finding this more recently, here is a new link to the javascript driver type mappings.
All the sessions of the conference are now available online