Specifying a primitive property type in a Cypher CREATE clause

Unlike perhaps a Java API, it seems, there is no way to tell whether a numeric property byte, short, intor long:

CREATE (n:Test {value: 1}) RETURN n

a property is always created long. I tried toInt(), but it is clearly understood in the mathematical sense of "integer" more than in the sense of the computer data type.

Is there some way I can just force a type?

We defined the model and want to insert test data using Cypher instructions, but the code using the data then failed with the help ClassCastException, because the types do not match.

+4
source share
1

cypher API, - .

, JSON , . "".

?

((Number)n.getProperty("value")).xxxValue() (xxx = int, long, byte)

+3

All Articles