cvs: phpdoc /en/reference/mongo versions.xml /en/reference/mongo/mongocollection find.xml group.xml /en/reference/mongo/mongocursor key.xml
/en/reference/mongo/mongogridfs storeupload.xml
| From: | Kristina Chodorow | Date: | Tue, 09 Jun 2009 19:20:59 +0000 |
| Subject: | cvs: phpdoc /en/reference/mongo versions.xml /en/reference/mongo/mongocollection find.xml group.xml /en/reference/mongo/mongocursor key.xml /en/reference/mongo/mongogridfs storeupload.xml |
||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4133@lists.php.net to get a copy of this message | ||
kristina Tue Jun 9 19:20:59 2009 UTC
Added files:
/phpdoc/en/reference/mongo/mongocollection group.xml
/phpdoc/en/reference/mongo/mongocursor key.xml
Modified files:
/phpdoc/en/reference/mongo versions.xml
/phpdoc/en/reference/mongo/mongocollection find.xml
/phpdoc/en/reference/mongo/mongogridfs storeupload.xml
Log:
examples, group, and key
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/versions.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/mongo/versions.xml diff -u phpdoc/en/reference/mongo/versions.xml:1.8 phpdoc/en/reference/mongo/versions.xml:1.9 --- phpdoc/en/reference/mongo/versions.xml:1.8 Thu Jun 4 14:21:00 2009 +++ phpdoc/en/reference/mongo/versions.xml Tue Jun 9 19:20:59 2009 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <!-- Do NOT translate this file --> @@ -60,6 +60,7 @@ <function name='mongocollection::validate' from='PECL mongo >=0.9.0'/> <function name='mongocollection::createdbref' from='PECL mongo >=0.9.0'/> <function name='mongocollection::getdbref' from='PECL mongo >=0.9.0'/> + <function name='mongocollection::group' from='PECL mongo >=0.9.2'/> <!-- MongoCursor --> <function name='mongocursor::__construct' from='PECL mongo >=0.9.0'/> <function name='mongocursor::hasnext' from='PECL mongo >=0.9.0'/> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongocollection/find.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/mongo/mongocollection/find.xml diff -u phpdoc/en/reference/mongo/mongocollection/find.xml:1.1 phpdoc/en/reference/mongo/mongocollection/find.xml:1.2 --- phpdoc/en/reference/mongo/mongocollection/find.xml:1.1 Wed May 20 22:31:40 2009 +++ phpdoc/en/reference/mongo/mongocollection/find.xml Tue Jun 9 19:20:59 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry xml:id="mongocollection.find" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoCollection::find</refname> @@ -43,12 +43,34 @@ </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a cursor for the search results. </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 + +// search for documents where 5 < x < 20 +$rangeQuery = array('x' => array( '$gt' => 5, '$lt' => 20 )); + +$cursor = $collection->find($rangeQuery); + +?> +]]> + </programlisting> + </example> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongogridfs/storeupload.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/mongo/mongogridfs/storeupload.xml diff -u phpdoc/en/reference/mongo/mongogridfs/storeupload.xml:1.1 phpdoc/en/reference/mongo/mongogridfs/storeupload.xml:1.2 --- phpdoc/en/reference/mongo/mongogridfs/storeupload.xml:1.1 Wed May 20 22:31:40 2009 +++ phpdoc/en/reference/mongo/mongogridfs/storeupload.xml Tue Jun 9 19:20:59 2009 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<refentry xml:id="mongogridfs.saveupload" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> +<!-- $Revision: 1.2 $ --> +<refentry xml:id="mongogridfs.storeupload" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoGridFS::storeUpload</refname> <refpurpose>Saves an uploaded file to the database</refpurpose> @@ -10,9 +10,9 @@ <refsect1 role="description"> &reftitle.description; <methodsynopsis> - <modifier>public</modifier> <type>MongoId</type><methodname>MongoGridFS::storeUpload</methodname> + <modifier>public</modifier> <type>mixed</type><methodname>MongoGridFS::storeUpload</methodname> <methodparam><type>string</type><parameter>name</parameter></methodparam> - <methodparam choice="opt"><type>array</type><parameter>extra</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> </refsect1> @@ -32,11 +32,11 @@ </varlistentry> <varlistentry> <term> - <parameter>extra</parameter> + <parameter>filename</parameter> </term> <listitem> <para> - Other metadata to add to the file saved. + String to be used as filename field in the database. </para> </listitem> </varlistentry> @@ -47,7 +47,7 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the id of the uploaded file. + Returns the _id of the uploaded file. </para> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongocollection/group.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mongo/mongocollection/group.xml +++ phpdoc/en/reference/mongo/mongocollection/group.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="mongocollection.group" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoCollection::group</refname> <refpurpose>Performs an operation similar to SQL's GROUP BY command</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <modifier>public</modifier> <type>array</type><methodname>MongoCollection::group</methodname> <methodparam><type>array</type><parameter>keys</parameter></methodparam> <methodparam><type>array</type><parameter>initial</parameter></methodparam> <methodparam><type>string</type><parameter>reduce</parameter></methodparam> <methodparam choice="opt"><type>array</type><parameter>condition</parameter><initializer>array()</initializer></methodparam> </methodsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term> <parameter>keys</parameter> </term> <listitem> <para> Fields to group by. </para> </listitem> </varlistentry> <varlistentry> <term> <parameter>initial</parameter> </term> <listitem> <para> Initial value of the aggregation counter object. </para> </listitem> </varlistentry> <varlistentry> <term> <parameter>reduce</parameter> </term> <listitem> <para> A function that aggregates (reduces) the objects iterated. </para> </listitem> </varlistentry> <varlistentry> <term> <parameter>condition</parameter> </term> <listitem> <para> An condition that must be true for a row to be considered. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an array containing the result. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>MongoCollection::group</function> example</title> <programlisting role="php"> <![CDATA[ <?php $collection->save(array("a" => 2)); $collection->save(array("b" => 5)); $collection->save(array("a" => 1)); // use all fields $keys = array(); // set intial values $initial = array("count" => 0); // JavaScript function to perform $reduce = "function (obj, prev) { prev.count++; }"; // only use documents where the "a" field is greater than 1 $condition = array("a" => array( '$gt' => 1)); $g = $collection->group($keys, $initial, $reduce, $condition); var_dump($g); ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ array(1) { [0]=> array(1) { ["count"]=> int(1) } } ]]> </screen> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongocursor/key.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mongo/mongocursor/key.xml +++ phpdoc/en/reference/mongo/mongocursor/key.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="mongocursor.key" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoCursor::key</refname> <refpurpose>Returns the current result's _id</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <modifier>public</modifier> <type>string</type><methodname>MongoCursor::key</methodname> <void/> </methodsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; &no.function.parameters; </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The current result's _id. </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/versions.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/mongo/versions.xml diff -u phpdoc/en/reference/mongo/versions.xml:1.8 phpdoc/en/reference/mongo/versions.xml:1.9 --- phpdoc/en/reference/mongo/versions.xml:1.8 Thu Jun 4 14:21:00 2009 +++ phpdoc/en/reference/mongo/versions.xml Tue Jun 9 19:20:59 2009 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <!-- Do NOT translate this file --> @@ -60,6 +60,7 @@ <function name='mongocollection::validate' from='PECL mongo >=0.9.0'/> <function name='mongocollection::createdbref' from='PECL mongo >=0.9.0'/> <function name='mongocollection::getdbref' from='PECL mongo >=0.9.0'/> + <function name='mongocollection::group' from='PECL mongo >=0.9.2'/> <!-- MongoCursor --> <function name='mongocursor::__construct' from='PECL mongo >=0.9.0'/> <function name='mongocursor::hasnext' from='PECL mongo >=0.9.0'/> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongocollection/find.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/mongo/mongocollection/find.xml diff -u phpdoc/en/reference/mongo/mongocollection/find.xml:1.1 phpdoc/en/reference/mongo/mongocollection/find.xml:1.2 --- phpdoc/en/reference/mongo/mongocollection/find.xml:1.1 Wed May 20 22:31:40 2009 +++ phpdoc/en/reference/mongo/mongocollection/find.xml Tue Jun 9 19:20:59 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry xml:id="mongocollection.find" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoCollection::find</refname> @@ -43,12 +43,34 @@ </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a cursor for the search results. </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 + +// search for documents where 5 < x < 20 +$rangeQuery = array('x' => array( '$gt' => 5, '$lt' => 20 )); + +$cursor = $collection->find($rangeQuery); + +?> +]]> + </programlisting> + </example> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongogridfs/storeupload.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/mongo/mongogridfs/storeupload.xml diff -u phpdoc/en/reference/mongo/mongogridfs/storeupload.xml:1.1 phpdoc/en/reference/mongo/mongogridfs/storeupload.xml:1.2 --- phpdoc/en/reference/mongo/mongogridfs/storeupload.xml:1.1 Wed May 20 22:31:40 2009 +++ phpdoc/en/reference/mongo/mongogridfs/storeupload.xml Tue Jun 9 19:20:59 2009 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> -<refentry xml:id="mongogridfs.saveupload" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> +<!-- $Revision: 1.2 $ --> +<refentry xml:id="mongogridfs.storeupload" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoGridFS::storeUpload</refname> <refpurpose>Saves an uploaded file to the database</refpurpose> @@ -10,9 +10,9 @@ <refsect1 role="description"> &reftitle.description; <methodsynopsis> - <modifier>public</modifier> <type>MongoId</type><methodname>MongoGridFS::storeUpload</methodname> + <modifier>public</modifier> <type>mixed</type><methodname>MongoGridFS::storeUpload</methodname> <methodparam><type>string</type><parameter>name</parameter></methodparam> - <methodparam choice="opt"><type>array</type><parameter>extra</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> </refsect1> @@ -32,11 +32,11 @@ </varlistentry> <varlistentry> <term> - <parameter>extra</parameter> + <parameter>filename</parameter> </term> <listitem> <para> - Other metadata to add to the file saved. + String to be used as filename field in the database. </para> </listitem> </varlistentry> @@ -47,7 +47,7 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the id of the uploaded file. + Returns the _id of the uploaded file. </para> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongocollection/group.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mongo/mongocollection/group.xml +++ phpdoc/en/reference/mongo/mongocollection/group.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="mongocollection.group" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoCollection::group</refname> <refpurpose>Performs an operation similar to SQL's GROUP BY command</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <modifier>public</modifier> <type>array</type><methodname>MongoCollection::group</methodname> <methodparam><type>array</type><parameter>keys</parameter></methodparam> <methodparam><type>array</type><parameter>initial</parameter></methodparam> <methodparam><type>string</type><parameter>reduce</parameter></methodparam> <methodparam choice="opt"><type>array</type><parameter>condition</parameter><initializer>array()</initializer></methodparam> </methodsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term> <parameter>keys</parameter> </term> <listitem> <para> Fields to group by. </para> </listitem> </varlistentry> <varlistentry> <term> <parameter>initial</parameter> </term> <listitem> <para> Initial value of the aggregation counter object. </para> </listitem> </varlistentry> <varlistentry> <term> <parameter>reduce</parameter> </term> <listitem> <para> A function that aggregates (reduces) the objects iterated. </para> </listitem> </varlistentry> <varlistentry> <term> <parameter>condition</parameter> </term> <listitem> <para> An condition that must be true for a row to be considered. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an array containing the result. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>MongoCollection::group</function> example</title> <programlisting role="php"> <![CDATA[ <?php $collection->save(array("a" => 2)); $collection->save(array("b" => 5)); $collection->save(array("a" => 1)); // use all fields $keys = array(); // set intial values $initial = array("count" => 0); // JavaScript function to perform $reduce = "function (obj, prev) { prev.count++; }"; // only use documents where the "a" field is greater than 1 $condition = array("a" => array( '$gt' => 1)); $g = $collection->group($keys, $initial, $reduce, $condition); var_dump($g); ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ array(1) { [0]=> array(1) { ["count"]=> int(1) } } ]]> </screen> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongocursor/key.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mongo/mongocursor/key.xml +++ phpdoc/en/reference/mongo/mongocursor/key.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="mongocursor.key" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoCursor::key</refname> <refpurpose>Returns the current result's _id</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <modifier>public</modifier> <type>string</type><methodname>MongoCursor::key</methodname> <void/> </methodsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; &no.function.parameters; </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The current result's _id. </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->