cvs: phpdoc /en/reference/mongo book.xml versions.xml /en/reference/mongo/mongocode construct.xml /en/reference/mongo/mongocollection count.xml
/en/reference/mongo/mongocursor count.xml
| From: | Kristina Chodorow | Date: | Tue, 02 Jun 2009 17:53:23 +0000 |
| Subject: | cvs: phpdoc /en/reference/mongo book.xml versions.xml /en/reference/mongo/mongocode construct.xml /en/reference/mongo/mongocollection count.xml /en/reference/mongo/mongocursor count.xml |
||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4099@lists.php.net to get a copy of this message | ||
kristina Tue Jun 2 17:53:23 2009 UTC
Added files:
/phpdoc/en/reference/mongo/mongocursor count.xml
Modified files:
/phpdoc/en/reference/mongo book.xml versions.xml
/phpdoc/en/reference/mongo/mongocode construct.xml
/phpdoc/en/reference/mongo/mongocollection count.xml
Log:
count and examples, removed util
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/book.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/mongo/book.xml diff -u phpdoc/en/reference/mongo/book.xml:1.6 phpdoc/en/reference/mongo/book.xml:1.7 --- phpdoc/en/reference/mongo/book.xml:1.6 Thu May 21 14:33:16 2009 +++ phpdoc/en/reference/mongo/book.xml Tue Jun 2 17:53:23 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <book xml:id="book.mongo" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Mongo</title> @@ -39,7 +39,6 @@ &reference.mongo.mongogridfs; &reference.mongo.mongogridfsfile; &reference.mongo.mongogridfscursor; - &reference.mongo.mongoutil; &reference.mongo.mongoid; &reference.mongo.mongocode; http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/versions.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/mongo/versions.xml diff -u phpdoc/en/reference/mongo/versions.xml:1.6 phpdoc/en/reference/mongo/versions.xml:1.7 --- phpdoc/en/reference/mongo/versions.xml:1.6 Thu May 21 14:33:16 2009 +++ phpdoc/en/reference/mongo/versions.xml Tue Jun 2 17:53:23 2009 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- Do NOT translate this file --> @@ -39,6 +39,7 @@ <function name='mongodb::setprofilinglevel' from='PECL mongo >=0.9.0'/> <function name='mongodb::createdbref' from='PECL mongo >=0.9.0'/> <function name='mongodb::getdbref' from='PECL mongo >=0.9.0'/> + <function name='mongodb::command' from='PECL mongo >=0.9.2'/> <!-- MongoCollection --> <function name='mongocollection::__construct' from='PECL mongo >=0.9.0'/> <function name='mongocollection::__tostring' from='PECL mongo >=0.9.0'/> @@ -74,9 +75,7 @@ <function name='mongocursor::rewind' from='PECL mongo >=0.9.0'/> <function name='mongocursor::valid' from='PECL mongo >=0.9.0'/> <function name='mongocursor::key' from='PECL mongo >=0.9.0'/> - <!-- MongoUtil --> - <function name='mongoutil::dbcommand' from='PECL mongo >=0.9.0'/> - <function name='mongoutil::toindexstring' from='PECL mongo >=0.9.0'/> + <function name='mongocursor::count' from='PECL mongo >=0.9.2'/> <!-- MongoGridFS --> <function name='mongogridfs::__construct' from='PECL mongo >=0.9.0'/> <function name='mongogridfs::find' from='PECL mongo >=0.9.0'/> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongocode/construct.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/mongo/mongocode/construct.xml diff -u phpdoc/en/reference/mongo/mongocode/construct.xml:1.1 phpdoc/en/reference/mongo/mongocode/construct.xml:1.2 --- phpdoc/en/reference/mongo/mongocode/construct.xml:1.1 Tue Mar 24 19:10:43 2009 +++ phpdoc/en/reference/mongo/mongocode/construct.xml Tue Jun 2 17:53:23 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry xml:id="mongocode.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -54,8 +54,8 @@ <refsect1 role="examples"> &reftitle.examples; <example> - <title><function>MongoCode::__construct</function> example</title> - <programlisting role="php"> + <title><function>MongoCode::__construct</function> example</title> + <programlisting role="php"> <![CDATA[ <?php @@ -64,9 +64,9 @@ ?> ]]> - </programlisting> - &example.outputs.similar; - <screen> + </programlisting> + &example.outputs.similar; + <screen> <![CDATA[ object(MongoCode)#1 (2) { ["scope"]=> @@ -78,7 +78,25 @@ string(80) "function(x) { for(i=0;i<10;i++) { db.foo.update({x:i}, {x:i+1}); } return x-1; }" } ]]> - </screen> + </screen> + </example> + + + <example> + <title>Using <function>MongoCode</function> with $where</title> + <para> + This example queries a collection for elements where the 'x' fields is less than $y. Notice that + PHP objects can be passed into the JavaScript scope and that the JavaScript function returns a boolean. + </para> + <programlisting role="php"> +<![CDATA[ +<?php + +$cursor = $collection->find(array('$where' => new MongoCode('function() { return this.x < y; }', array('y'=>$y)))); + +?> +]]> + </programlisting> </example> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongocollection/count.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/mongo/mongocollection/count.xml diff -u phpdoc/en/reference/mongo/mongocollection/count.xml:1.1 phpdoc/en/reference/mongo/mongocollection/count.xml:1.2 --- phpdoc/en/reference/mongo/mongocollection/count.xml:1.1 Wed May 20 22:31:40 2009 +++ phpdoc/en/reference/mongo/mongocollection/count.xml Tue Jun 2 17:53:23 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry xml:id="mongocollection.count" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoCollection::count</refname> @@ -11,13 +11,37 @@ &reftitle.description; <methodsynopsis> <modifier>public</modifier> <type>int</type><methodname>MongoCollection::count</methodname> - <void /> + <methodparam choice="opt"><type>array</type><parameter>query</parameter><initializer>array()</initializer></methodparam> + <methodparam choice="opt"><type>array</type><parameter>fields</parameter><initializer>array()</initializer></methodparam> </methodsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; - &no.function.parameters; + <para> + <variablelist> + <varlistentry> + <term> + <parameter>query</parameter> + </term> + <listitem> + <para> + Only count documents matching this query. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>fields</parameter> + </term> + <listitem> + <para> + Only count documents with these fields. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> </refsect1> <refsect1 role="returnvalues"> @@ -26,6 +50,36 @@ Returns the number of documents. </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <example> + <title><function>MongoCollection::count</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$collection->insert(array('x'=>1)); +$collection->insert(array('x'=>2)); +$collection->insert(array('x'=>3, 'y'=>1)); + +var_dump($collection->count()); +var_dump($collection->count(array('x'=>1))); +var_dump($collection->count(array(), array('z'=>1))); + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +float(3) +float(1) +float(0) +]]> + </screen> + </example> + </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongocursor/count.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mongo/mongocursor/count.xml +++ phpdoc/en/reference/mongo/mongocursor/count.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="mongocursor.count" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoCursor::count</refname> <refpurpose>Counts the number of results for this query</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <modifier>public</modifier> <type>int</type><methodname>MongoCursor::count</methodname> <void/> </methodsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; &no.function.parameters; </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The number of documents returned by this cursor's query. </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/book.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/mongo/book.xml diff -u phpdoc/en/reference/mongo/book.xml:1.6 phpdoc/en/reference/mongo/book.xml:1.7 --- phpdoc/en/reference/mongo/book.xml:1.6 Thu May 21 14:33:16 2009 +++ phpdoc/en/reference/mongo/book.xml Tue Jun 2 17:53:23 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <book xml:id="book.mongo" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Mongo</title> @@ -39,7 +39,6 @@ &reference.mongo.mongogridfs; &reference.mongo.mongogridfsfile; &reference.mongo.mongogridfscursor; - &reference.mongo.mongoutil; &reference.mongo.mongoid; &reference.mongo.mongocode; http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/versions.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/mongo/versions.xml diff -u phpdoc/en/reference/mongo/versions.xml:1.6 phpdoc/en/reference/mongo/versions.xml:1.7 --- phpdoc/en/reference/mongo/versions.xml:1.6 Thu May 21 14:33:16 2009 +++ phpdoc/en/reference/mongo/versions.xml Tue Jun 2 17:53:23 2009 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- Do NOT translate this file --> @@ -39,6 +39,7 @@ <function name='mongodb::setprofilinglevel' from='PECL mongo >=0.9.0'/> <function name='mongodb::createdbref' from='PECL mongo >=0.9.0'/> <function name='mongodb::getdbref' from='PECL mongo >=0.9.0'/> + <function name='mongodb::command' from='PECL mongo >=0.9.2'/> <!-- MongoCollection --> <function name='mongocollection::__construct' from='PECL mongo >=0.9.0'/> <function name='mongocollection::__tostring' from='PECL mongo >=0.9.0'/> @@ -74,9 +75,7 @@ <function name='mongocursor::rewind' from='PECL mongo >=0.9.0'/> <function name='mongocursor::valid' from='PECL mongo >=0.9.0'/> <function name='mongocursor::key' from='PECL mongo >=0.9.0'/> - <!-- MongoUtil --> - <function name='mongoutil::dbcommand' from='PECL mongo >=0.9.0'/> - <function name='mongoutil::toindexstring' from='PECL mongo >=0.9.0'/> + <function name='mongocursor::count' from='PECL mongo >=0.9.2'/> <!-- MongoGridFS --> <function name='mongogridfs::__construct' from='PECL mongo >=0.9.0'/> <function name='mongogridfs::find' from='PECL mongo >=0.9.0'/> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongocode/construct.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/mongo/mongocode/construct.xml diff -u phpdoc/en/reference/mongo/mongocode/construct.xml:1.1 phpdoc/en/reference/mongo/mongocode/construct.xml:1.2 --- phpdoc/en/reference/mongo/mongocode/construct.xml:1.1 Tue Mar 24 19:10:43 2009 +++ phpdoc/en/reference/mongo/mongocode/construct.xml Tue Jun 2 17:53:23 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry xml:id="mongocode.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -54,8 +54,8 @@ <refsect1 role="examples"> &reftitle.examples; <example> - <title><function>MongoCode::__construct</function> example</title> - <programlisting role="php"> + <title><function>MongoCode::__construct</function> example</title> + <programlisting role="php"> <![CDATA[ <?php @@ -64,9 +64,9 @@ ?> ]]> - </programlisting> - &example.outputs.similar; - <screen> + </programlisting> + &example.outputs.similar; + <screen> <![CDATA[ object(MongoCode)#1 (2) { ["scope"]=> @@ -78,7 +78,25 @@ string(80) "function(x) { for(i=0;i<10;i++) { db.foo.update({x:i}, {x:i+1}); } return x-1; }" } ]]> - </screen> + </screen> + </example> + + + <example> + <title>Using <function>MongoCode</function> with $where</title> + <para> + This example queries a collection for elements where the 'x' fields is less than $y. Notice that + PHP objects can be passed into the JavaScript scope and that the JavaScript function returns a boolean. + </para> + <programlisting role="php"> +<![CDATA[ +<?php + +$cursor = $collection->find(array('$where' => new MongoCode('function() { return this.x < y; }', array('y'=>$y)))); + +?> +]]> + </programlisting> </example> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongocollection/count.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/mongo/mongocollection/count.xml diff -u phpdoc/en/reference/mongo/mongocollection/count.xml:1.1 phpdoc/en/reference/mongo/mongocollection/count.xml:1.2 --- phpdoc/en/reference/mongo/mongocollection/count.xml:1.1 Wed May 20 22:31:40 2009 +++ phpdoc/en/reference/mongo/mongocollection/count.xml Tue Jun 2 17:53:23 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry xml:id="mongocollection.count" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoCollection::count</refname> @@ -11,13 +11,37 @@ &reftitle.description; <methodsynopsis> <modifier>public</modifier> <type>int</type><methodname>MongoCollection::count</methodname> - <void /> + <methodparam choice="opt"><type>array</type><parameter>query</parameter><initializer>array()</initializer></methodparam> + <methodparam choice="opt"><type>array</type><parameter>fields</parameter><initializer>array()</initializer></methodparam> </methodsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; - &no.function.parameters; + <para> + <variablelist> + <varlistentry> + <term> + <parameter>query</parameter> + </term> + <listitem> + <para> + Only count documents matching this query. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>fields</parameter> + </term> + <listitem> + <para> + Only count documents with these fields. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> </refsect1> <refsect1 role="returnvalues"> @@ -26,6 +50,36 @@ Returns the number of documents. </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <example> + <title><function>MongoCollection::count</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$collection->insert(array('x'=>1)); +$collection->insert(array('x'=>2)); +$collection->insert(array('x'=>3, 'y'=>1)); + +var_dump($collection->count()); +var_dump($collection->count(array('x'=>1))); +var_dump($collection->count(array(), array('z'=>1))); + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +float(3) +float(1) +float(0) +]]> + </screen> + </example> + </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mongo/mongocursor/count.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/mongo/mongocursor/count.xml +++ phpdoc/en/reference/mongo/mongocursor/count.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="mongocursor.count" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoCursor::count</refname> <refpurpose>Counts the number of results for this query</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <modifier>public</modifier> <type>int</type><methodname>MongoCursor::count</methodname> <void/> </methodsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; &no.function.parameters; </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The number of documents returned by this cursor's query. </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 -->