andy
andy

Reputation: 13

When I run this cypher 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')),it will gets the result 'true'.When I run cqlreturn 'a' in [],it gets the result 'false', But why the first cql will gets true?

Upvotes: 1

Views: 51

Answers (1)

logisima
logisima

Reputation: 7478

If you try this query : RETURN any(x in null WHERE x='a') Result is null because it's neither true neither false due to the list that is null.

Now if you try this query : RETURN all(x IN [] WHERE null) Result is true, because the list is empty, so you can put whatever where clauses you want (even if WHERE null does not mean anything).

So the conjunction of those queries, ie. return all( x in [] where any(y in x where x='a')) is true

Upvotes: 1

Related Questions