What is the { low: ###, high: ### } returned from a Cypher query

(Will B Mease) #1


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?

(Andrew Bowman) #2

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.

(Andrew Bowman) #3

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.