[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:
Related
related to PHPLIB-312 Does aggregate's batchSize option onl... Closed

 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: CDRIVER-2371 make mongoc_collection_aggregate use batchSize for multiple batches
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/334fed1a5db71f9e9f38ef6256c285969427e232

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.

Generated at Wed Feb 07 21:15:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.