Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-9093

getMore command docs say batchSize can be 0, but 0 is an invalid value for batchSize

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • DOCS Q3 W10
    • Affects Version/s: None
    • Component/s: drivers
    • Labels:
    • 0.25

      The documentation says that batchSize is a non-negative integer but an error is thrown if batchSize (/ limit) is 0
      https://docs.mongodb.com/manual/reference/command/getMore/

      client = Mongo::Client.new(["localhost:27017"])
      102.times do |i|
         client[:test].insert_one(a: i)  
      end
      client[:test].find({}, limit: 0).to_a
      
      DEBUG -- : MONGODB | localhost:27017 | admin.find | STARTED | {"find"=>"test", "filter"=>{}, "limit"=>0}
      DEBUG -- : MONGODB | localhost:27017 | admin.find | SUCCEEDED | 0.0021939999999999998s
      DEBUG -- : MONGODB | localhost:27017 | admin.getMore | STARTED | {"getMore"=>15001859357, "collection"=>"test", "batchSize"=>0}
      DEBUG -- : MONGODB | localhost:27017 | admin.getMore | FAILED | Batch size for getMore must be positive, but received: 0 (2) | 0.00036199999999999996s
      Mongo::Error::OperationFailure: Batch size for getMore must be positive, but received: 0 (2)
      from /Users/emily/Code/driver/mongo-ruby-driver/lib/mongo/operation/result.rb:256:in `validate!'
      

            Assignee:
            allison.moore@mongodb.com Allison Reinheimer Moore
            Reporter:
            emily.stolfo Emily Stolfo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              7 years, 30 weeks ago