Search code examples
neo4jcypher

neo4j return an integer instead of {high: 0, low: 10}


Is there a way to return just an integer through cypher?

I am working with neo4j and the javascript driver. However when I do a count() I get {low: 10, high: 0}. I would like to force this to return a low integer instead of the object above. Is this possible through cypher?

Note that I don't want to do this in the neo4j javascript driver and prefer to do this in cypher since I know it will be a low number...


Solution

  • Cypher only works with Long and Double values. Javascript isn't able to adequately represent 64-bit Longs.

    There's advice here from the Neo4j javascript driver for handling this when providing parameters to Neo4j queries, as well as for handling returned longs.