The docs for options.FindOptions.SetLimit() suggest that negative limits are valid, when in fact the server returns an error if you try ("Error: (BadValue) Limit value must be non-negative, but received: <N>"). This is because the driver uses the newer find command, which doesn't support negative limits.
(mgo supported negative limits, presumably by converting it to a positive limit + singleBatch=true, which adds to the confusion - as does the fact that the shell's cursor.limit() supports negative limits too!)
- is related to
-
DRIVERS-2120 Add CRUD spec test for negative limit
- Closed