svn: /phpdoc/en/trunk/reference/mongo/mongocollection/ getindexinfo.xml

From: Date: Fri, 18 Nov 2011 15:04:04 +0000
Subject: svn: /phpdoc/en/trunk/reference/mongo/mongocollection/ getindexinfo.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-9047@lists.php.net to get a copy of this message
derick Fri, 18 Nov 2011 15:04:04 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=319493 Log: Fixing documentation for getIndexInfo() (PHP-265). Changed paths: U phpdoc/en/trunk/reference/mongo/mongocollection/getindexinfo.xml Modified: phpdoc/en/trunk/reference/mongo/mongocollection/getindexinfo.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/mongocollection/getindexinfo.xml 2011-11-18 14:32:51 UTC (rev 319492) +++ phpdoc/en/trunk/reference/mongo/mongocollection/getindexinfo.xml 2011-11-18 15:04:04 UTC (rev 319493) @@ -4,7 +4,7 @@ <refentry xml:id="mongocollection.getindexinfo" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoCollection::getIndexInfo</refname> - <refpurpose>Returns an array of index names for this collection</refpurpose> + <refpurpose>Returns information about indexes on this collection</refpurpose> </refnamediv> <refsect1 role="description"> @@ -23,9 +23,74 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns a list of index names. + This function returns an array in which each elements describes an array. + The elements contain the values <literal>name</literal> for the name of + the index, <literal>ns</literal> for the namespace (the name of the + collection), <literal>key</literal> containing a list of all the keys + and their sort order that make up the index and <literal>_id</literal> + containing a MongoID object with the ID of this index. </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <example> + <title><function>MongoCollection::find</function> example</title> + <para>This example demonstrates how to search for a range.</para> + <programlisting role="php"> +<![CDATA[ +<?php + +$m = new Mongo; +$c = $m->selectCollection('project', 'outfits'); +var_dump($c->getIndexInfo()); + +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +array(8) { + [0] => + 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' + } +} +]]> + </screen> + <para> + See <classname>MongoCursor</classname> for more information how to work with cursors. + </para> + </example> + </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables:

« previous php.doc.cvs (#9047) next »