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


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?

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.

1 Like

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.

For anyone else finding this more recently, here is a new link to the javascript driver type mappings.