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

Does aggregate's batchSize option only affect the initial batch?

    • Type: Icon: Task Task
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.1.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      ubuntu 14.04 LTS 64bit, php 7.1

      Hi,

      Firstly, thank you as always for the great library.
      I have an aggregation query like the following:

      function aggregateFtw()
      {
      	return $this->collection->aggregate(
      		[
      			[
      				'$group' => [
      					'_id' => '$user_id',
      					'liked_post_ids' => [
      						'$addToSet'	=> '$post_id'
      					]
      				]
      			]
      		],
      		[
      			'allowDiskUse'	=> true,
      			'batchSize' => 1000
      		]);
      }
      

      Does the batchSize parameter only apply to the initial batch, or also to subsequent batches? It is important for me, in order to avoid cursor timeouts, and the aggregation documentation made me a little nervous (see https://docs.mongodb.com/manual/reference/method/db.collection.aggregate/#specify-an-initial-batch-size)

      Thanks,

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            mlis mils
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: