Moodle PHP Documentation 4.1
Moodle 4.1.11 (Build: 20240610) (c8c84b4af18)
|
Public Member Functions | |
__construct (string $databaseName, ?string $collectionName, array $pipeline, array $options=[]) | |
Constructs an aggregate command. | |
execute (Server $server) | |
Execute the operation. | |
getCommandDocument (Server $server) | |
Returns the command document for this operation. | |
MongoDB\Operation\Aggregate::__construct | ( | string | $databaseName, |
?string | $collectionName, | ||
array | $pipeline, | ||
array | $options = [] ) |
Constructs an aggregate command.
Supported options:
comment (mixed): BSON value to attach as a comment to this command.
Only string values are supported for server versions < 4.4.
let (document): Map of parameter names and values. Values must be constant or closed expressions that do not reference document fields. Parameters can then be accessed as variables in an aggregate expression context (e.g. "$$var").
This is not supported for server versions < 5.0 and will result in an exception at execution time if used.
readPreference (MongoDB\Driver\ReadPreference): Read preference.
This option is ignored if an $out or $merge stage is specified.
useCursor (boolean): Indicates whether the command will request that the server provide results using a cursor. The default is true.
This option allows users to turn off cursors if necessary to aid in mongod/mongos upgrades.
Note: Collection-agnostic commands (e.g. $currentOp) may be executed by specifying null for the collection name.
string | $databaseName | Database name |
string | null | $collectionName | Collection name |
array | $pipeline | List of pipeline operations |
array | $options | Command options |
InvalidArgumentException | for parameter/option parsing errors |
MongoDB\Operation\Aggregate::execute | ( | Server | $server | ) |
Execute the operation.
ArrayIterator|Cursor |
UnexpectedValueException | if the command response was malformed |
UnsupportedException | if read concern or write concern is used and unsupported |
DriverRuntimeException | for other driver errors (e.g. connection errors) |
Implements MongoDB\Operation\Executable.
MongoDB\Operation\Aggregate::getCommandDocument | ( | Server | $server | ) |
Returns the command document for this operation.
array |
Implements MongoDB\Operation\Explainable.