Fix example output for MongoCollection::getIndexInfo()

The previous output looked nothing like var_dump(). The indexes are are comparable to those in the previous example, although there are some additional fields and I changed the geo-spatial index to "2dsphere".


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@335757 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jeremy Mikola 2015-01-15 16:24:54 +00:00
parent 2fba051b83
commit 96ac68c599

View file

@ -51,42 +51,68 @@ var_dump($c->getIndexInfo());
&example.outputs.similar;
<screen>
<![CDATA[
array(
0 => array(
"v" => 1,
"key" => array(
"_id" => 1,
),
"ns" => "test.venues",
"name" => "_id_",
),
1 => array(
"v" => 1,
"key" => array(
"name" => 1,
),
"unique" : true,
"ns" => "test.venues",
"name" => "name_1",
),
2 => array(
"v" => 1,
"key" => array(
"type" => 1,
"createdAt" => -1,
),
"ns" => "test.venues",
"name" => "type_1_createdAt_-1",
),
3 => array(
"v" => 1,
"key" => array(
"location" => "2d",
),
"ns" => "test.venues",
"name" => "location_2d",
),
)
array(4) {
[0]=>
array(4) {
["v"]=>
int(1)
["key"]=>
array(1) {
["_id"]=>
int(1)
}
["name"]=>
string(4) "_id_"
["ns"]=>
string(11) "test.venues"
}
[1]=>
array(4) {
["v"]=>
int(1)
["key"]=>
array(1) {
["name"]=>
float(1)
}
["name"]=>
string(6) "name_1"
["ns"]=>
string(11) "test.venues"
}
[2]=>
array(4) {
["v"]=>
int(1)
["key"]=>
array(2) {
["type"]=>
float(1)
["createdAt"]=>
float(-1)
}
["name"]=>
string(19) "type_1_createdAt_-1"
["ns"]=>
string(11) "test.venues"
}
[3]=>
array(5) {
["v"]=>
int(1)
["key"]=>
array(1) {
["location"]=>
string(8) "2dsphere"
}
["name"]=>
string(17) "location_2dsphere"
["ns"]=>
string(11) "test.venues"
["2dsphereIndexVersion"]=>
int(2)
}
}
]]>
</screen>
</example>