MongoCursor
PHP Manual

MongoCursor::info

(PECL mongo >=1.0.5)

MongoCursor::infoGets the query, fields, limit, and skip for this cursor

Description

public array MongoCursor::info ( void )

This can be called before or after the query.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Returns the namespace, limit, skip, query, and fields for this cursor. In version 1.0.10+, it also returns whether the cursor is pre- or post-query.

Exemples

Exemple #1 MongoCursor::info() example

<?php

$m 
= new Mongo();
$cursor $m->foo->bar->find(array("x" => 4), array("y" => false));
var_dump($cursor->info());

?>

L'exemple ci-dessus va afficher quelque chose de similaire à :

array(5) {
  ["ns"]=>
  string(7) "foo.bar"
  ["limit"]=>
  int(0)
  ["skip"]=>
  int(0)
  ["query"]=>
  array(1) {
    ["x"]=>
    int(4)
  }
  ["fields"]=>
  array(1) {
    ["y"]=>
    int(0)
  }
}

MongoCursor
PHP Manual