【问题标题】:how to get values from list string in neo4j cypher如何从 Neo4j 密码中的列表字符串中获取值
【发布时间】:2019-01-02 07:39:10
【问题描述】:

我在变量 score 中有一个值 ["1-0", "4-0"],我想分别从中获取 4 和 0 并返回它们

RETURN toInteger(trim(r.scoreHTFT[1])) 返回 null

【问题讨论】:

  • 您不也想分别获得“1”和“0”吗?或者您总是想要 last 列表元素或 的结果第二个 - 或者你正在尝试做其他事情?
  • 我找到了我一直在寻找的答案。感谢您的关注。根据您的问题,我希望返回值 4 和 0 而不是 1 和 0。

标签: string list neo4j cypher


【解决方案1】:

你可以试试这个

UNWIND  ["15-2","18-1"] as r
with split(r,"-") as splitFromDash
return toInteger(splitFromDash[1])

【讨论】:

    猜你喜欢
    • 2017-02-13
    • 2015-10-01
    • 1970-01-01
    • 2012-08-28
    • 1970-01-01
    • 1970-01-01
    • 2016-04-04
    • 1970-01-01
    • 2014-12-02
    相关资源
    最近更新 更多