If I write a query
SELECT * where x < 99, I expect documents where
x=1 to be returned, but not documents where
N1QL Collation Order treats booleans as less than integers, followed by strings and then
JsonArray. I understand that this is valuable for
ORDER BY: If there is a document with
x=99 and another document with
x="foo", then the engine needs to return them in some order and it is best that that order be deterministic.
WHERE clauses, clearly
"foo" < 9 and
"foo" > 99 should both be
false , as they should be.)
Why does Couchbase do it this way?
(Based on this StackOverflow question.)