Paul
Paul

Reputation: 3

Neo4j - Issue creating relationships with Int64.MaxValue stores incorrect value

I'm using neo4j v3.1.0 and creating the following simple graph.

create(d:User{code:'testid'})-[:STATE {to:9223372036854775807}]->(UserState{name:'Paul',email:'[email protected]'})

The value in the to relationship is a long.MaxValue which I am using as an indicator for knowing what is current data. The graph db I'm developing has to store historical data and relationships have to/from properties on the relationship for this purpose. I've omitted the full complexities of this to highlight the issue.

The problem is that the to value is stored as 9223372036854776000 and not the 9223372036854775807 I specified which is larger than Int64.MaxValue. Deserializing using Newtonsoft in .NET blows up of course.

See the screen shot to see the issue

I could just reduce the size of the number, which would suffice for my use case, but if I really needed store this value it wouldn't be able to. I would rather know if this is an actual issue with Neo4j or if there is some config I need to do.

Any help would be great. Thanks

Upvotes: 0

Views: 53

Answers (1)

Christophe Willemsen
Christophe Willemsen

Reputation: 20185

Make sure that you use the Bolt protocol driver for the neo4j browser, int64 are not supported in json so that is why you cannot see the real value in the browser if the http driver is used instead (while the value will be correct in the db -> check with the shell).

Go to the browsers settings and check the box Use bolt protocol when available

enter image description here

Relaunch your query and you should see the correct result :

enter image description here

Upvotes: 2

Related Questions