IT. Expert System.

PHP

Return an explanation of the query, often useful for optimization and debugging


MongoCursor::explain

(PECL mongo >=0.9.2)

MongoCursor::explainReturn an explanation of the query, often useful for optimization and debugging

Description

public array MongoCursor::explain ( void )

Parameters

This function has no parameters.

Return Values

Returns an explanation of the query.

Examples

Example #1 MongoCursor::explain() example

<?php

$cursor 
$collection->find(array("x"=>1), array("y"));
$cursor->sort(array("z" => 1))->limit(4)->skip(5);

var_dump($cursor->explain());

?>

The above example will output something similar to:

 array(8) { ["cursor"]=> string(15) "BtreeCursor x_1" ["startKey"]=> array(1) {  ["x"]=>  int(1) } ["endKey"]=> array(1) {  ["x"]=>  int(1) } ["nscanned"]=> float(4) ["n"]=> int(4) ["scanAndOrder"]=> int(1) ["millis"]=> int(3) ["allPlans"]=> array(2) {  [0]=>  array(3) {  ["cursor"]=>  string(15) "BtreeCursor x_1"  ["startKey"]=>  array(1) {   ["x"]=>   int(1)  }  ["endKey"]=>  array(1) {   ["x"]=>   int(1)  }  }  [1]=>  array(3) {  ["cursor"]=>  string(11) "BasicCursor"  ["startKey"]=>  array(0) {  }  ["endKey"]=>  array(0) {  }  } } } 

Errors/Exceptions

Throws MongoConnectionException if it cannot reach the database.

See Also

MongoDB core docs on » explain.



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 794 / 96446712. Delta: 0.05708 с