Moodle PHP Documentation 4.1
Moodle 4.1.11 (Build: 20240610) (c8c84b4af18)
MongoDB\Operation\DatabaseCommand Class Reference
Inheritance diagram for MongoDB\Operation\DatabaseCommand:
MongoDB\Operation\Executable

Public Member Functions

 __construct (string $databaseName, $command, array $options=[])
 Constructs a command.
 
 execute (Server $server)
 Execute the operation.
 

Constructor & Destructor Documentation

◆ __construct()

MongoDB\Operation\DatabaseCommand::__construct ( string $databaseName,
$command,
array $options = [] )

Constructs a command.

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
string$databaseNameDatabase name
array | object$commandCommand document
array$optionsOptions for command execution
Exceptions
InvalidArgumentExceptionfor parameter/option parsing errors

Member Function Documentation

◆ execute()

MongoDB\Operation\DatabaseCommand::execute ( Server $server)

Execute the operation.

See also
Executable\execute()
Return values
Cursor

Implements MongoDB\Operation\Executable.


The documentation for this class was generated from the following file: