Cypher 将数字创建为 long.如何创建整数? [英] Cypher creates number as a long. How do I create an integer?
问题描述
我在 Neo4j 中遇到类型问题.我正在尝试使用以下查询创建一个具有整数值为 1 的变量编号的节点:
I have a problem with types in Neo4j. I am trying with the following query to create a node with a variable number with the integer value 1:
Create (n:Test{numer:1})
当我从 Java api 获取节点时,我收到一个错误,告诉我它的类型为 long.
When I am getting the node from the Java api I am getting an error telling me that it is of type long.
如何查看 Neo4J 中保存的变量类型?如何保存整数?
How can I see of what type a variable is saved in Neo4J? How can I save an integer?
推荐答案
如果您使用 Cypher 或 REST API,那么 Neo4j(内部)将 Java 的 Long 用于整数值,而 Java 的 Double 用于浮点值.
If you use Cypher or REST API then Neo4j (internally) use Java's Long for integer values and Java's Double for floating point values.
在 Java API 中,您可以使用以下数据类型
In Java API you can use following datatypes
- 布尔值
- 字节
- 简短
- 内部
- 长
- 浮动
- 双重
- 字符
- 字符串
http://neo4j.com/docs/stable/property-values-详细.html
这篇关于Cypher 将数字创建为 long.如何创建整数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!