当我 运行 这个密码 cql 'return all( x in [] where any(y in x where x='a'))'

When I run this cypher cql 'return all( x in [] where any(y in x where x='a'))'

当我运行这个密码cqlreturn all( x in [] where any(y in x where x='a'))时,它会得到结果'true'。当我运行cqlreturn 'a' in []时,它会得到结果'false',但为什么第一个 cql 会得到 true?

如果您尝试这个查询:RETURN any(x in null WHERE x='a') 结果是 null,因为它既不是 true,也不是 false,因为列表是 null

现在,如果您尝试这个查询:RETURN all(x IN [] WHERE null) 结果是 true,因为列表是空的,所以你可以放任何你想要的 where 子句(即使 WHERE null 没有任何意义)。

所以这些查询的结合,即。 return all( x in [] where any(y in x where x='a'))true