-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
This relates somewhat to PHPLIB-312, where a user inquired whether the batchSize parameter for aggregate() applied to only to the initial batch or also to subsequent batches (i.e. getMore) requests.
Currently, the Aggregate operation, which is used by change streams, only uses its batchSize option in the initial aggregate command. This is consistent with the shell's own db.collection.aggregate() helper and the use case for specifying an initial batch size. The shell expects users to call cursor.batchSize() if they wish to control the batch size for subsequent getMore operations.
For change streams, no results are returned in the initial aggregate response, as there are logically no changes to report at the time the stream is created. The batchSize option for change streams is therefore intended to apply to subsequent getMore operations on the cursor. This is problematic
- The Aggregation operation's batchSize option has a different purpose. This might be solved if we introduce a new option (e.g. getMoreBatchSize).
- PHPC itself currently has no API to configure the batch size on a command cursor. For basic find queries, the batch size is set once and applies to the initial find command and subsequent getMore operations; however, command cursors will require a different API to differentiate between the two cases.
- depends on
-
PHPC-1109 Support batchSize getMore option for command cursors
- Closed
- is related to
-
PHPLIB-312 Does aggregate's batchSize option only affect the initial batch?
- Closed