I am not being able to convert the string value of an array (e.g. score:["1", "0"]
) into an Integer in Neo4j.
I have tried:
MATCH (n:Game {game_id:"1"})
RETURN toInteger(n.score[0])
This query returns a null
value as a result.
I tried your query, but it works fine for me. This is my example data set:
CREATE (n:Game {game_id:"1", score:["1","0"]})
This is the query:
MATCH (n:Game {game_id:"1"})
RETURN toInteger(n.score[0])
And it returns:
╒═══════════════════════╕
│"toInteger(n.score[0])"│
╞═══════════════════════╡
│1 │
└───────────────────────┘