Fixing documentation for getIndexInfo() (PHP-265).

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@319493 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Derick Rethans 2011-11-18 15:04:04 +00:00
parent b410ecb367
commit 1d1996e068

View file

@ -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: