public MongoCommandCursor MongoCollection::aggregateCursor    ( array $command   [, array $options  ] )

MongoCollection::aggregateCursorExecute an aggregation pipeline command and retrieve results through a cursor

pipeline

The Aggregation Framework pipeline to execute.

options

Options for the aggregation command. Valid options include:

  • "allowDiskUse"

    Allow aggregation stages to write to temporary files

  • "cursor"

    It is possible to configure how many initial documents the server should return with the first result set. The default initial batch size is 101. You can change it by adding the batchSize option:

    <?php
    $collection
    ->aggregateCursor
        
    $pipeline,
        [ 
    "cursor" => [ "batchSize" => ] ]
    );

    This option only configures the size of the first batch. To configure the size of future batches, please use the MongoCommandCursor::batchSize() method on the returned MongoCommandCursor object.

  • "explain"

    Return information on the processing of the pipeline. This option may cause the command to return a result document that is unsuitable for constructing a MongoCommandCursor. If you need to use this option, you should consider using MongoCollection::aggregate().

  • "maxTimeMS"

    Указывает суммарный лимит времени в миллисекундах на обработку операции (не включая время простоя) на сервере. Если операция на стороне сервера не завершилась за это время, то вызывается исключение MongoExecutionTimeoutException.