svn: /phpdoc/en/trunk/reference/mongo/ book.xml ini.xml mongocollection/update.xml mongodb/lasterror.xml mongoemptyobj.xml

From: Date: Wed, 28 Oct 2009 21:10:00 +0000
Subject: svn: /phpdoc/en/trunk/reference/mongo/ book.xml ini.xml mongocollection/update.xml mongodb/lasterror.xml mongoemptyobj.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-5233@lists.php.net to get a copy of this message
kristina Wed, 28 Oct 2009 21:10:00 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=290037 Log: mongo.cmd ini opt, examples Changed paths: U phpdoc/en/trunk/reference/mongo/book.xml U phpdoc/en/trunk/reference/mongo/ini.xml U phpdoc/en/trunk/reference/mongo/mongocollection/update.xml U phpdoc/en/trunk/reference/mongo/mongodb/lasterror.xml D phpdoc/en/trunk/reference/mongo/mongoemptyobj.xml Modified: phpdoc/en/trunk/reference/mongo/book.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/book.xml 2009-10-28 19:52:49 UTC (rev 290036) +++ phpdoc/en/trunk/reference/mongo/book.xml 2009-10-28 21:10:00 UTC (rev 290037) @@ -36,7 +36,6 @@ &reference.mongo.mongodb; &reference.mongo.mongocollection; &reference.mongo.mongocursor; - &reference.mongo.mongoemptyobj; &reference.mongo.mongogridfs; &reference.mongo.mongogridfsfile; &reference.mongo.mongogridfscursor; Modified: phpdoc/en/trunk/reference/mongo/ini.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/ini.xml 2009-10-28 19:52:49 UTC (rev 290036) +++ phpdoc/en/trunk/reference/mongo/ini.xml 2009-10-28 21:10:00 UTC (rev 290037) @@ -51,6 +51,11 @@ <entry>262144</entry> <entry>PHP_INI_SYSTEM</entry> </row> + <row> + <entry><link linkend="ini.mongo.cmd">mongo.cmd</link></entry> + <entry>$</entry> + <entry>PHP_INI_ALL</entry> + </row> </tbody> </tgroup> </table> @@ -152,6 +157,18 @@ </listitem> </varlistentry> + <varlistentry xml:id="ini.mongo.cmd"> + <term> + <parameter>mongo.cmd</parameter> + <type>string</type> + </term> + <listitem> + <para> + A character to be used in place of $. + </para> + </listitem> + </varlistentry> + </variablelist> </para> </section> Modified: phpdoc/en/trunk/reference/mongo/mongocollection/update.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/mongocollection/update.xml 2009-10-28 19:52:49 UTC (rev 290036) +++ phpdoc/en/trunk/reference/mongo/mongocollection/update.xml 2009-10-28 21:10:00 UTC (rev 290037) @@ -60,6 +60,44 @@ Returns if the update was successfully sent to the database. </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <example> + <title><function>MongoCollection::update</function></title> + <para> + Adding an address field to a document. + </para> + <programlisting role="php"> +<![CDATA[ +<?php + +$c->insert(array("firstname" => "Bob", "lastname" => "Jones" )); +$newdata = array('$set' => array("address" => "1 Smith Lane")); +$c->update(array("firstname" => "Bob"), $newdata); + +var_dump($c->findOne(array("firstname" => "Bob"))); + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +array(4) { + ["_id"]=> + object(MongoId)#6 (0) { + } + ["firstname"]=> + string(3) "Bob" + ["lastname"]=> + string(5) "Jones" + ["address"]=> + string(12) "1 Smith Lane" +} +]]> + </screen> + </example> + </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: Modified: phpdoc/en/trunk/reference/mongo/mongodb/lasterror.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/mongodb/lasterror.xml 2009-10-28 19:52:49 UTC (rev 290036) +++ phpdoc/en/trunk/reference/mongo/mongodb/lasterror.xml 2009-10-28 21:10:00 UTC (rev 290037) @@ -23,9 +23,66 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the error, if there was one, or &null;. + Returns the error, if there was one. </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <example> + <title><function>MongoDB::lastError</function> &null; error example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$db->resetError(); +var_dump($db->lastError()); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +array(3) { + ["err"]=> + NULL + ["n"]=> + int(0) + ["ok"]=> + float(1) +} +]]> + </screen> + </example> + <example> + <title><function>MongoDB::lastError</function> duplicate key example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$c = $db->selectCollection("foo"); + +// insert two documents with the same _id +$c->insert(array("_id" => 1)); +$c->insert(array("_id" => 1)); + +var_dump($db->lastError()); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +array(3) { + ["err"]=> + string(64) "E11000 duplicate key errorindex: foo.foo.$_id_ dup key: { : 1 }" + ["n"]=> + int(0) + ["ok"]=> + float(1) +} +]]> + </screen> + </example> + </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: Deleted: phpdoc/en/trunk/reference/mongo/mongoemptyobj.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/mongoemptyobj.xml 2009-10-28 19:52:49 UTC (rev 290036) +++ phpdoc/en/trunk/reference/mongo/mongoemptyobj.xml 2009-10-28 21:10:00 UTC (rev 290037) @@ -1,98 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- $Revision$ --> - -<phpdoc:classref xml:id="class.mongoemptyobj" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> - - <title>The MongoEmptyObj class</title> - <titleabbrev>MongoEmptyObj</titleabbrev> - - <partintro> - -<!-- {{{ MongoEmptyObj intro --> - <section xml:id="mongoemptyobj.intro"> - &reftitle.intro; - <para> - This class is used to insert an empty object into the database. - </para> - <para> - Inserting an empty array will create an array-type document, which can - be used for (among other things) $push updates: - </para> - <programlisting role="php"> -<![CDATA[ -<?php -$collection->insert(array('x' => array())); -?> -]]> - </programlisting> - <para>The shell shows that an empty array is saved as an array:</para> - <programlisting role="javascript"> -<![CDATA[ -> db.collection.findOne() -{ 'x' : [] } -]]> - </programlisting> - <para> - Inserting a MongoEmptyObj will create an object-type document: - </para> - <programlisting role="php"> -<![CDATA[ -<?php -$collection->insert(array('x' => new MongoEmptyObj())); -?> -]]> - </programlisting> - <para>The shell shows that a MongoEmptyObj is saved as an object:</para> - <programlisting role="javascript"> -<![CDATA[ -> db.collection.findOne() -{ 'x' : {} } -]]> - </programlisting> - </section> -<!-- }}} --> - - <section xml:id="mongoemptyobj.synopsis"> - &reftitle.classsynopsis; - -<!-- {{{ Synopsis --> - <classsynopsis> - <ooclass><classname>MongoEmptyObj</classname></ooclass> - -<!-- {{{ Class synopsis --> - <classsynopsisinfo> - <ooclass> - <classname>MongoEmptyObj</classname> - </ooclass> - </classsynopsisinfo> -<!-- }}} --> - - </classsynopsis> -<!-- }}} --> - - </section> - - </partintro> - -</phpdoc:classref> - -<!-- 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 -indent-tabs-mode:nil -sgml-parent-document:nil -sgml-default-dtd-file:"~/.phpdoc/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 --->

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