[GODRIVER-1160] driver.BatchCursor Next returns true when first batch is empty Created: 24/Jun/19 Updated: 28/Oct/23 Resolved: 26/Jun/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Core API |
| Affects Version/s: | None |
| Fix Version/s: | 1.1.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Matthew Chiaravalloti | Assignee: | Matthew Chiaravalloti |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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 |
| Comments |
| Comment by Githook User [ 26/Jun/19 ] |
|
Author: {'name': 'Matthew Chiaravalloti', 'email': 'matthew.chiaravalloti@mongodb.com', 'username': 'mattChiaravalloti'}Message: Make BatchCursor.Next return false if first batch is empty Change-Id: I467bb96f8d9ec820f4f0814e939ced4e4d450c28 |