【发布时间】:2016-08-25 15:29:32
【问题描述】:
如何在 Cypher 查询中将 NaN 表示为文字?
情况
我在数据库中有一个 NaN 值:
match (a) with max(a.CONCENTRATION) as m return m
将返回
m
---
NaN
Cypher reference in Neo4j 提到这可能是因为存储了特殊值:
特殊值 java.lang.Double.NaN 被认为大于所有其他数字。
我尝试了什么
但是,现在它在那里,我不知道如何在搜索中匹配它们,因为您收到以下错误
输入
match (a) where a.CONCENTRATION = NaN return a limit 10
错误
Variable `NaN` not defined (line 1, column 35 (offset: 34))
其他参考资料
Cypher reference in Neo4j 没有提到 NaN 文字,除非我错过了。
我用谷歌搜索了“Cypher NaN”,但我得到的最接近的结果是如何添加 inf/NaN,它没有直接解决 (How to add infinity, NaN, or null values to a double[] property on a node in Cypher/Neo4j)。
【问题讨论】:
-
stackoverflow.com/questions/27194534/… 可能你检查过了,它应该对你有点帮助。