[CDRIVER-2371] mongoc_collection_aggregate only uses batchSize for first batch Created: 14/Nov/17 Updated: 28/Oct/23 Resolved: 13/Dec/17 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.10.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | Pavithra Vetriselvan |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
At least as far back as libmongoc 1.6, the "batchSize" field in mongoc_collection_aggregate's "opts" argument is used only for the first batch, and subsequent batches accept the server's default batch size. |
| Comments |
| Comment by Githook User [ 11/Dec/17 ] |
|
Author: {'name': 'Pavithra Vetriselvan', 'email': 'pavi@MacBook-Pro-77.local'}Message: |
| Comment by A. Jesse Jiryu Davis [ 04/Dec/17 ] |
|
Here's a branch that reproduces the bug using a mock-server test: https://github.com/ajdavis/mongo-c-driver/tree/CDRIVER-2371 We'll need to set the batch size on the cursor. I think the fix should go near the end of mongoc_collection_aggregate(), maybe as simple as calling mongoc_cursor_set_batch_size on the new mongoc_cursor_t struct? We must also update the documentation in mongoc_collection_aggregate.rst to mention the "batchSize" option in the "opts" argument. |