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

driver.BatchCursor Next returns true when first batch is empty

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.1.0
    • Affects Version/s: None
    • Component/s: Core API
    • None

      The comment for driver.BatchCursor.Next(context.Context) says "This method will return false when an empty batch is returned." However, if the first batch is empty, it returns true. This ticket should make Next return false when bc.firstBatch is true and the batch is empty; this is the problematic code: https://github.com/mongodb/mongo-go-driver/blob/24c422eb6da5e148e55df79804a7058fa322979f/x/mongo/driver/batch_cursor.go#L167

            Assignee:
            matthew.chiaravalloti@mongodb.com Matthew Chiaravalloti
            Reporter:
            matthew.chiaravalloti@mongodb.com Matthew Chiaravalloti
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: