After a command cursor is created, libmongoc assigns the maxAwaitTimeMS and batchSize options to the command cursor. I believe we have two options:
- Add batchSize as a new Command constructor option, akin to what we did for maxAwaitTimeMS in
PHPC-1029. In this case, we could capture batchSize and apply it after the command cursor is created in phongo_execute_command(). This will then require changes in PHPLIB to ensure that Aggregate also copies batchSize to the new Command constructor option.
- Instead of adding a Command constructor option, we can inspect the command document for a batchSize option earlier in phongo_execute_command() and apply it in the same place as above. This requires no changes in PHPLIB. It also means that the same batchSize value will apply to the original command and subsequent getMore.
Note: the second choice (inferring batchSize may have implications for PHPLIB-312, where a user had asked if batchSize applied to getMore at all; however, they did not specifically request the ability to differentiate batchSize options for the initial aggregate and subsequent getMore commands.
I'm inclined to go with the second solution (inferring batchSize) as it requires minimal changes to the PHPC API or PHPLIB. It also allows us the opportunity to introduce a Command constructor option later, which would take precedence.
- is depended on by
-
PHPLIB-321 batchSize option does not affect getMore behavior for change streams
- Closed
- is related to
-
PHPC-1029 Support maxTimeMS getMore option for tailable command cursors
- Closed
-
PHPLIB-312 Does aggregate's batchSize option only affect the initial batch?
- Closed
-
SERVER-25551 Aggregation batchSize can't be set on subsequent getMore in the shell
- Closed