密码创建的数字很长.如何创建整数? [英] Cypher creates number as a long. How do I create an integer?

查看:54
本文介绍了密码创建的数字很长.如何创建整数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对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

  • 布尔值
  • 字节
  • int
  • 浮动
  • double
  • char
  • 字符串

http://neo4j.com/docs/stable/property-values- detail.html

这篇关于密码创建的数字很长.如何创建整数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆