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

Add SetBatchSize method to driver.BatchCursor

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.6.0
    • Affects Version/s: None
    • Component/s: API
    • None

      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.

            Assignee:
            isabella.siu@mongodb.com Isabella Siu (Inactive)
            Reporter:
            lorenz.huelsbergen@mongodb.com Lorenz Huelsbergen
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: