DatabaseCommand
in package
implements
Executable
Operation for executing a database command.
Tags
Interfaces, Classes, Traits and Enums
- Executable
Table of Contents
- $command : array<string|int, mixed>|Command|object
- $databaseName : string
- $options : array<string|int, mixed>
- __construct() : mixed
- Constructs a command.
- execute() : Cursor
- Execute the operation.
- createOptions() : array<string|int, mixed>
- Create options for executing the command.
Properties
$command
private
array<string|int, mixed>|Command|object
$command
$databaseName
private
string
$databaseName
$options
private
array<string|int, mixed>
$options
Methods
__construct()
Constructs a command.
public
__construct(string $databaseName, array<string|int, mixed>|object $command[, array<string|int, mixed> $options = [] ]) : mixed
Supported options:
-
readPreference (MongoDB\Driver\ReadPreference): The read preference to use when executing the command. This may be used when issuing the command to a replica set or mongos node to ensure that the driver sets the wire protocol accordingly or adds the read preference to the command document, respectively.
-
session (MongoDB\Driver\Session): Client session.
-
typeMap (array): Type map for BSON deserialization. This will be applied to the returned Cursor (it is not sent to the server).
Parameters
- $databaseName : string
-
Database name
- $command : array<string|int, mixed>|object
-
Command document
- $options : array<string|int, mixed> = []
-
Options for command execution
Tags
Return values
mixed —execute()
Execute the operation.
public
execute(Server $server) : Cursor
Parameters
- $server : Server
Tags
Return values
Cursor —createOptions()
Create options for executing the command.
private
createOptions() : array<string|int, mixed>