Explain
in package
FinalYes
Operation for the explain command.
Tags
Table of Contents
Constants
- VERBOSITY_ALL_PLANS = 'allPlansExecution'
- VERBOSITY_EXEC_STATS = 'executionStats'
- VERBOSITY_QUERY = 'queryPlanner'
Properties
- $databaseName : string
- $explainable : Explainable
- $options : array<string|int, mixed>
Methods
- __construct() : mixed
- Constructs an explain command for explainable operations.
- execute() : array<string|int, mixed>|object
- Execute the operation.
- createCommand() : Command
- Create the explain command.
- createOptions() : array<string|int, mixed>
- Create options for executing the command.
Constants
VERBOSITY_ALL_PLANS
public
mixed
VERBOSITY_ALL_PLANS
= 'allPlansExecution'
VERBOSITY_EXEC_STATS
public
mixed
VERBOSITY_EXEC_STATS
= 'executionStats'
VERBOSITY_QUERY
public
mixed
VERBOSITY_QUERY
= 'queryPlanner'
Properties
$databaseName
private
string
$databaseName
$explainable
private
Explainable
$explainable
$options
private
array<string|int, mixed>
$options
= []
Methods
__construct()
Constructs an explain command for explainable operations.
public
__construct(string $databaseName, Explainable $explainable[, array<string|int, mixed> $options = [] ]) : mixed
Supported options:
-
comment (mixed): BSON value to attach as a comment to this command.
This is not supported for servers versions < 4.4.
-
readPreference (MongoDB\Driver\ReadPreference): Read preference.
-
session (MongoDB\Driver\Session): Client session.
-
typeMap (array): Type map for BSON deserialization. This will be used used for the returned command result document.
-
verbosity (string): The mode in which the explain command will be run.
Parameters
- $databaseName : string
-
Database name
- $explainable : Explainable
-
Operation to explain
- $options : array<string|int, mixed> = []
-
Command options
Tags
execute()
Execute the operation.
public
execute(Server $server) : array<string|int, mixed>|object
Parameters
- $server : Server
Tags
Return values
array<string|int, mixed>|objectcreateCommand()
Create the explain command.
private
createCommand() : Command
Return values
CommandcreateOptions()
Create options for executing the command.
private
createOptions() : array<string|int, mixed>