[GODRIVER-1900] Add SetBatchSize method to driver.BatchCursor Created: 25/Feb/21  Updated: 28/Oct/23  Resolved: 08/Jul/21

Status: Closed
Project: Go Driver
Component/s: API
Affects Version/s: None
Fix Version/s: 1.6.0

Type: Improvement Priority: Major - P3
Reporter: Lorenz Huelsbergen Assignee: Isabella Siu (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Cloners
is cloned by DRIVERS-1589 Allow changing BatchSize for getMores... Backlog
Related
related to GODRIVER-1605 Allow cursor options to be specified ... Closed

 Description   

Problem Statement/Rationale

Currently, when the BatchSize(0) option is used to request an immediate cursor (and no docs), the default BatchSize goes into effect for subsequent getMores and there's apparently no way to specify a custom BatchSize in this scenario. 

(This is because BatchSize is being overloaded to both set the BatchSize and to request an immediate cursor on the first aggregation.)

This is problematic currently in ADL when we need to use BatchSize(0) but the number of docs returned in subsequent batches is so large that our processing exceeds server's cursor expiry threshold.

Proposed Change/Action

Support some mechanism to set BatchSize for subsequent getMores; or barring that, provide a new mechanism to get the first cursor without any docs and leave BatchSize for specifying all batch sizes.

Expected Impact

It will provide nice flexibility and allow them to more easily do things that are difficult now.

UX Notes (Acceptance Criteria)
Have the functionality of BatchSize(0) for requesting an immediate cursor and the ability to specify a custom BatchSize for subsequent getMores/Nexts.

 

Open Questions

If there are alternative ways of improving the situation, include that information here.

Additional Notes

Any additional information that may be useful to include.



 Comments   
Comment by Githook User [ 08/Jul/21 ]

Author:

{'name': 'Isabella Siu', 'email': 'isabella.siu@mongodb.com', 'username': 'iwysiu'}

Message: GODRIVER-1900 add SetBatchSize to driver.BatchCursor (#699)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/d41f34875299206e594e7c54910d8646099951d6

Generated at Thu Feb 08 08:37:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.