Documentation

Explain
in package
implements Executable

Operation for the explain command.

Tags
see
Collection::explain()
see
http://docs.mongodb.org/manual/reference/command/explain/

Interfaces, Classes, Traits and Enums

Executable

Table of Contents

VERBOSITY_ALL_PLANS  = 'allPlansExecution'
VERBOSITY_EXEC_STATS  = 'executionStats'
VERBOSITY_QUERY  = 'queryPlanner'
$databaseName  : string
$explainable  : Explainable
$options  : array<string|int, mixed>
$wireVersionForAggregate  : int
__construct()  : mixed
Constructs an explain command for explainable operations.
execute()  : array<string|int, mixed>|object
Execute the operation.
createOptions()  : array<string|int, mixed>
Create options for executing the command.
isFindAndModify()  : bool

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

$wireVersionForAggregate

private static int $wireVersionForAggregate = 7

Methods

__construct()

Constructs an explain command for explainable operations.

public __construct(string $databaseName, Explainable $explainable[, array<string|int, mixed> $options = [] ]) : mixed

Supported options:

  • 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
throws
InvalidArgumentException

for parameter/option parsing errors

Return values
mixed

execute()

Execute the operation.

public execute(Server $server) : array<string|int, mixed>|object
Parameters
$server : Server
Tags
see
Executable::execute()
throws
UnsupportedException

if the server does not support explaining the operation

throws
RuntimeException

for other driver errors (e.g. connection errors)

Return values
array<string|int, mixed>|object

isFindAndModify()

private isFindAndModify(Explainable $explainable) : bool
Parameters
$explainable : Explainable
Return values
bool

Search results