Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-867

options.FindOptions.SetLimit() docs suggest negative limits are still supported, but they're not

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.0.2
    • Affects Version/s: 1.0.0-rc2
    • Component/s: CRUD
    • None
    • Fully Compatible

      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!)

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            duncan.armstrong@mongodb.com Duncan Armstrong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: