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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-rc2
    • Fix Version/s: 1.0.2
    • Component/s: CRUD
    • Labels:
      None
    • 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!)

        Attachments

          Activity

            People

            Assignee:
            divjot.arora Divjot Arora
            Reporter:
            duncan.armstrong Duncan Armstrong
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: