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

XMLWordPrintableJSON

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

      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:
              Jeremy Mikola
              Reporter:
              mils
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: