如何在neo4j中将数组的字符串值转换为整数?

时间:2017-12-18 01:48:41

标签: neo4j spring-data-neo4j spring-data-neo4j-4 neo4j-ogm

我无法将数组的字符串值(例如score:["1", "0"])转换为Neo4j中的Integer。

我试过了:

MATCH (n:Game {game_id:"1"})
RETURN toInteger(n.score[0])

此查询返回null值。

1 个答案:

答案 0 :(得分:0)

我尝试了你的查询,但它对我来说很好。这是我的示例数据集:

CREATE (n:Game {game_id:"1", score:["1","0"]})

这是查询:

MATCH (n:Game {game_id:"1"})
RETURN toInteger(n.score[0])

它返回:

╒═══════════════════════╕
│"toInteger(n.score[0])"│
╞═══════════════════════╡
│1                      │
└───────────────────────┘
相关问题