如何使用cypher将整数值添加到Neo4j Node Property?

时间:2016-03-26 21:01:05

标签: neo4j cypher

我想存储一些有整数的节点,我如何让neo4j明白我发送的字符是整数。

我试过

MATCH (a:Venture_capital),(b:Organization)
WHERE a.name = "Google"  AND int(b.from) = "2004" AND String(b.member) = "John L. Hennessy"
CREATE (a)-[:board_members]->(b)-[:organization]->(a)

MATCH (a:Venture_capital),(b:Organization)
WHERE a.name = "Google"  AND b.from = int("2004") AND b.member = String("John L. Hennessy")
CREATE (a)-[:board_members]->(b)-[:organization]->(a)

两者都不起作用。 :(

我该怎么做?

Neo4j默认不允许我存储日期时间和空间数据,这很奇怪。

2 个答案:

答案 0 :(得分:2)

尝试:

toFloat(5)

这是一种解决方法,更多详细信息请参阅github上的"Provide a way to set properties with Integer (not Long) values in Cypher #7652"

答案 1 :(得分:1)

使用toInt(string)

MATCH (a:Venture_capital),(b:Organization)
WHERE a.name = "Google"  AND b.from = toInt("2004") 
  AND b.member = "John L. Hennessy"
CREATE (a)-[:board_members]->(b)-[:organization]->(a)