Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-321

batchSize option does not affect getMore behavior for change streams

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      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.

            Assignee:
            katherine.walker@mongodb.com Katherine Walker (Inactive)
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: