如何将数组的字符串值转换为neo4j中的整数?
问题描述:
我不能够的阵列(例如score:["1", "0"]
)的字符串值转换成在Neo4j的一个整数。如何将数组的字符串值转换为neo4j中的整数?
我曾尝试:
MATCH (n:Game {game_id:"1"})
RETURN toInteger(n.score[0])
该查询返回null
值作为结果。
答
我想你的查询,但它为我工作得很好。这是我的示例数据集:
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 │
└───────────────────────┘
确定该节点所期待的'score'属性值? MATCH(n:Game {game_id:“1”})的返回值是什么?RETURN n.score'? – cybersam