Closed bwgjoseph closed 3 years ago
Looks like not passing in a limit (i.e not setting a value in findOptions) and passing in a 0 is basically doing the same thing. I have opened an Investigation ticket (this is mainly for the team to investigate and let us know why it is what it is).
https://github.com/couchbaselabs/node-ottoman/issues/465 - Investigation Ticket
Agreed, I would like to know why first too. Not sure if there's any history behind it.
0 was treated as false not a value, we are going to fix this.
I'm not sure if it's the way different databases handles LIMIT 0
differently, or generally, between SQL and noSQL databases.
Seem like SQL (or SQL-like) handles LIMIT 0 with no result, and noSQL handles LIMIT 0 with all results like mongodb
I'm fine if ottoman is fixing to follow n1ql where it does not return any result if limit is 0
https://github.com/couchbaselabs/node-ottoman/issues/465 issue created
Available with next release
Fixed w/ alpha 29
Hi,
I was testing out the
limit
option and notice a interesting difference in term of result returned betweenottoman
andquery
The result is as such
Notice that if using
find
, all results will be returned whenlimit: 0
but if the same is passed via thequery
, then no result will be returned. Wondering if this is intended, or a bug?Thanks