[DOCS-9093] getMore command docs say batchSize can be 0, but 0 is an invalid value for batchSize Created: 05/Oct/16  Updated: 02/Nov/16  Resolved: 06/Oct/16

Status: Closed
Project: Documentation
Component/s: drivers
Affects Version/s: None
Fix Version/s: DOCS Q3 W10

Type: Bug Priority: Major - P3
Reporter: Emily Stolfo Assignee: Allison Reinheimer Moore
Resolution: Done Votes: 0
Labels: bite-sized
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to RUBY-1147 Error when sending getMore command on... Closed
Participants:
Days since reply: 7 years, 18 weeks, 6 days ago
Story Points: 0.25

 Description   

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



 Comments   
Comment by Allison Reinheimer Moore [ 06/Oct/16 ]

Updated on the upcoming and 3.2 docs – db.collection.find().batchSize(0) in 3.0 does not complain, so I didn't backport that far Thanks emily.stolfo

Comment by Githook User [ 06/Oct/16 ]

Author:

{u'username': u'schmalliso', u'name': u'Allison Moore', u'email': u'allison.moore@10gen.com'}

Message: DOCS-9093: batchSize must be a positive integer (not 0)
Branch: v3.2
https://github.com/mongodb/docs/commit/5f7c087877a940a092b0316268d02ad49b1896ec

Comment by Githook User [ 06/Oct/16 ]

Author:

{u'username': u'schmalliso', u'name': u'Allison Moore', u'email': u'allison.moore@10gen.com'}

Message: DOCS-9093: batchSize must be a positive integer (not 0)
Branch: master
https://github.com/mongodb/docs/commit/9d15bb070030e453655e8bbb94cf82b9a3fcd0a6

Comment by Allison Reinheimer Moore [ 06/Oct/16 ]

emily.stolfo Hrm! Edited because I lied: the getMore command with batchSize = 0 does indeed error out in the shell just like your experience! We'll get that field tweaked

Limits of 0 do appear to be valid though. I shouldn't triage tickets before having my morning cuppa tea.

Generated at Thu Feb 08 07:57:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.