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

driver.BatchCursor Next returns true when first batch is empty

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Component/s: Core API
    • Labels:
      None

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: