我使用的是同事的数据库,在某些情况下,他们将整数值存储为字符串。在Cypher中可以将字符串转换为数字类型吗?如果没有,是否可以添加到功能路线图中?
我希望使用Cypher查询来返回具有值大于100的特定属性的节点。我的示例查询如下所示:(获取一个收取相同项目费用超过100小时的人的列表)。
match (p1)-[r1:charged_project]->(proj)<-[r2:charged_project]-(p2)
where p1 <> p2 and
r1.hours > 100 and r2.hours > 100
return p1, proj, p2 limit 10;
这导致了这个错误,因为一些r1.hours
是字符串。
IncomparableValuesException: Don't know how to compare that.
Left: "16" (String); Right: 100 (Long)
I am aware there's a similar question out there about this -但解决方案是Integer ->字符串转换,它可以由str()
完成。这对我来说是行不通的,我想我需要相当于java的Long.parseLong
。
发布于 2014-05-03 12:28:37
由于Neo4j 2.0.3对于String有一个toInt
和一个toFloat
函数,请参见http://docs.neo4j.org/chunked/stable/query-functions-scalar.html#functions-toint。
https://stackoverflow.com/questions/23430945
复制相似问题