From 1d1996e0687e70797c2429de670e20aa317dab3b Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Fri, 18 Nov 2011 15:04:04 +0000 Subject: [PATCH] Fixing documentation for getIndexInfo() (PHP-265). git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@319493 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../mongo/mongocollection/getindexinfo.xml | 69 ++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/reference/mongo/mongocollection/getindexinfo.xml b/reference/mongo/mongocollection/getindexinfo.xml index 0b9c8a9bd4..eaccd9e440 100644 --- a/reference/mongo/mongocollection/getindexinfo.xml +++ b/reference/mongo/mongocollection/getindexinfo.xml @@ -4,7 +4,7 @@ MongoCollection::getIndexInfo - Returns an array of index names for this collection + Returns information about indexes on this collection @@ -23,9 +23,74 @@ &reftitle.returnvalues; - Returns a list of index names. + This function returns an array in which each elements describes an array. + The elements contain the values name for the name of + the index, ns for the namespace (the name of the + collection), key containing a list of all the keys + and their sort order that make up the index and _id + containing a MongoID object with the ID of this index. + + + &reftitle.examples; + + <function>MongoCollection::find</function> example + This example demonstrates how to search for a range. + +selectCollection('project', 'outfits'); +var_dump($c->getIndexInfo()); + +?> +]]> + + &example.outputs; + + + array(3) { + 'name' => + string(4) '_id_' + 'ns' => + string(12) 'project.outfits' + 'key' => + array(1) { + '_id' => + int(1) + } + } +... + [7] => + array(4) { + '_id' => + class MongoId#12 (1) { + public $$id => string(24) '4d6f7abd44670a1513190000' + } + 'ns' => + string(12) 'project.outfits' + 'key' => + array(2) { + 'created' => + int(-1) + 'userid' => + int(1) + } + 'name' => + string(19) 'created_-1_userid_1' + } +} +]]> + + + See MongoCursor for more information how to work with cursors. + + +