PHP Класс Phalcon\Db\Adapter\MongoDB\Operation\Aggregate

См. также: MongoDB\Collection::aggregate()
См. также: http://docs.mongodb.org/manual/reference/command/aggregate/
Наследование: implements Phalcon\Db\Adapter\MongoDB\Operation\Executable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $databaseName, string $collectionName, array $pipeline, array $options = [] ) Constructs an aggregate command.
execute ( MongoDB\Driver\Server $server ) : Traversable Execute the operation.

Приватные методы

Метод Описание
createCommand ( MongoDB\Driver\Server $server, boolean $isCursorSupported ) : MongoDB\Driver\Command Create the aggregate command.

Описание методов

__construct() публичный метод

Supported options: * allowDiskUse (boolean): Enables writing to temporary files. When set to true, aggregation stages can write data to the _tmp sub-directory in the dbPath directory. The default is false. * batchSize (integer): The number of documents to return per batch. * bypassDocumentValidation (boolean): If true, allows the write to opt out of document level validation. This only applies when the $out stage is specified. For servers < 3.2, this option is ignored as document level validation is not available. * maxTimeMS (integer): The maximum amount of time to allow the query to run. * readConcern (MongoDB\Driver\ReadConcern): Read concern. Note that a "majority" read concern is not compatible with the $out stage. For servers < 3.2, this option is ignored as read concern is not available. * readPreference (MongoDB\Driver\ReadPreference): Read preference. * typeMap (array): Type map for BSON deserialization. This will be applied to the returned Cursor (it is not sent to the server). This is not supported for inline aggregation results (i.e. useCursor option is false or the server versions < 2.6). * useCursor (boolean): Indicates whether the command will request that the server provide results using a cursor. The default is true. For servers < 2.6, this option is ignored as aggregation cursors are not available. For servers >= 2.6, this option allows users to turn off cursors if necessary to aid in mongod/mongos upgrades.
public __construct ( string $databaseName, string $collectionName, array $pipeline, array $options = [] )
$databaseName string Database name
$collectionName string Collection name
$pipeline array List of pipeline operations
$options array Command options

execute() публичный метод

Execute the operation.
См. также: Executable::execute()
public execute ( MongoDB\Driver\Server $server ) : Traversable
$server MongoDB\Driver\Server
Результат Traversable