1 | <?php |
||
10 | class ExplainQueryService |
||
11 | { |
||
12 | const VERBOSITY_QUERY_PLANNER = 'queryPlanner'; |
||
13 | const VERBOSITY_EXECUTION_STATS = 'executionStats'; |
||
14 | const VERBOSITY_ALL_PLAN_EXECUTION = 'allPlansExecution'; |
||
15 | |||
16 | public static $acceptedMethods= [ |
||
17 | 'count', |
||
18 | 'distinct', |
||
19 | 'find', |
||
20 | 'findOne', |
||
21 | 'findOneAndUpdate', |
||
22 | 'findOneAndDelete', |
||
23 | 'deleteOne', |
||
24 | 'deleteMany', |
||
25 | 'aggregate', |
||
26 | ]; |
||
27 | |||
28 | /** @var ClientRegistry */ |
||
29 | private $clientRegistry; |
||
30 | |||
31 | /** |
||
32 | * Constructs a explain command. |
||
33 | * |
||
34 | * Supported options: |
||
35 | * verbosity : queryPlanner | executionStats Mode | allPlansExecution (default) |
||
36 | * The explain command provides information on the execution of the following commands: |
||
37 | * count, distinct, group, find, findAndModify, delete, and update. |
||
38 | * |
||
39 | * @param ClientRegistry $clientRegistry |
||
40 | */ |
||
41 | public function __construct(ClientRegistry $clientRegistry) |
||
46 | |||
47 | /** |
||
48 | * Execute the operation. |
||
49 | * |
||
50 | * @param Query $query |
||
51 | * @param string $verbosity |
||
52 | * |
||
53 | * @return Cursor |
||
54 | */ |
||
55 | public function execute(Query $query, string $verbosity = self::VERBOSITY_ALL_PLAN_EXECUTION): Cursor |
||
71 | } |
||
72 |