[prev in list] [next in list] [prev in thread] [next in thread]
List: php-doc-cvs
Subject: [DOC-CVS] =?utf-8?q?svn:_/phpdoc/en/trunk/reference/mongo/mongocollection/_getindexinfo.xml?=
From: Jeremy_Mikola <jmikola () php ! net>
Date: 2013-01-29 16:03:18
Message-ID: svn-jmikola-1359475398-329340-1456992574 () svn ! php ! net
[Download RAW message or body]
jmikola Tue, 29 Jan 2013 16:03:18 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=329340
Log:
Fix MongoCollection::getIndexInfo() return and example docs
https://jira.mongodb.org/browse/PHP-670
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 2013-01-29 14:57:48 UTC (rev 329339)
+++ phpdoc/en/trunk/reference/mongo/mongocollection/getindexinfo.xml 2013-01-29 16:03:18 UTC (rev 329340)
@@ -16,81 +16,91 @@
</refsect1>
<refsect1 role="parameters">
- &reftitle.parameters;
+ &reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
- 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.
+ This function returns an array in which each element describes an index.
+ Elements will contain the values <literal>name</literal> for the name of
+ the index, <literal>ns</literal> for the namespace (a combination of the
+ database and collection name), and <literal>key</literal> for a list of all
+ fields in the index and their ordering. Additional values may be present for
+ special indexes, such as <literal>unique</literal> or
+ <literal>sparse</literal>.
</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>
+ <title><function>MongoCollection::getIndexInfo</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
-$m = new Mongo;
-$c = $m->selectCollection('project', 'outfits');
+$m = new MongoClient();
+$c = $m->selectCollection('test', 'venues');
var_dump($c->getIndexInfo());
?>
]]>
</programlisting>
- &example.outputs;
+ &example.outputs.similar;
<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'
- }
-}
+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",
+ ),
+)
]]>
</screen>
- <para>
- See <classname>MongoCursor</classname> for more information how to work with cursors.
- </para>
</example>
</refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ MongoDB core docs on
+ <link xlink:href="&url.mongodb.dochub.indexes;">vanilla indexes</link> and
+ <link xlink:href="&url.mongodb.dochub.geo;">geospatial indexes</link>.
+ </para>
+ </refsect1>
+
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
--
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic