[GODRIVER-867] options.FindOptions.SetLimit() docs suggest negative limits are still supported, but they're not Created: 07/Mar/19 Updated: 28/Oct/23 Resolved: 29/Apr/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | CRUD |
| Affects Version/s: | 1.0.0-rc2 |
| Fix Version/s: | 1.0.2 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Duncan Armstrong | Assignee: | Divjot Arora (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Description |
|
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!) |
| Comments |
| Comment by Githook User [ 29/Apr/19 ] |
|
Author: {'name': 'Divjot Arora', 'username': 'divjotarora', 'email': 'divjot.arora@10gen.com'}Message: Support negative limits for find commands Change-Id: Ibaad9e1a081969499a91ca426f38c54bede7fad7 |
| Comment by Githook User [ 29/Apr/19 ] |
|
Author: {'email': 'divjot.arora@10gen.com', 'name': 'Divjot Arora', 'username': 'divjotarora'}Message: Support negative limits for find commands Change-Id: Ibaad9e1a081969499a91ca426f38c54bede7fad7 |
| Comment by Divjot Arora (Inactive) [ 24/Apr/19 ] |
|
CR: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/451903 |
| Comment by Jeffrey Yemin [ 07/Mar/19 ] |
|
The CRUD spec still requires negative limit support, so Go driver should support it for consistency, though it appears there are no CRUD spec tests that assert it. |