svn: /phpdoc/en/trunk/reference/mongo/ mongocollection/insert.xml versions.xml
| From: | Kristina Chodorow | Date: | Thu, 27 Aug 2009 22:50:20 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/mongo/ mongocollection/insert.xml versions.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4784@lists.php.net to get a copy of this message | ||
kristina Thu, 27 Aug 2009 22:50:20 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=287824
Log:
snapshot and example
Changed paths:
U phpdoc/en/trunk/reference/mongo/mongocollection/insert.xml
U phpdoc/en/trunk/reference/mongo/versions.xml
Modified: phpdoc/en/trunk/reference/mongo/mongocollection/insert.xml
===================================================================
--- phpdoc/en/trunk/reference/mongo/mongocollection/insert.xml 2009-08-27 22:28:23 UTC (rev 287823)
+++ phpdoc/en/trunk/reference/mongo/mongocollection/insert.xml 2009-08-27 22:50:20 UTC (rev 287824)
@@ -39,6 +39,56 @@
Returns if the array was not empty (an empty array will not be inserted).
</para>
</refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns if the arrays were saved.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example>
+ <title><function>MongoCollection::insert</function> _id example</title>
+ <para>
+ Inserting an object will add an _id field to it, unless it is passed by reference.
+ </para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+$a = array('x' => 1);
+$collection->insert($a);
+var_dump($a)
+
+$b = array('x' => 1);
+$ref = &$b;
+$collection->insert($ref);
+var_dump($ref);
+
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+array(2) {
+ ["x"]=>
+ int(1)
+ ["_id"]=>
+ object(MongoId)#4 (0) {
+ }
+}
+array(1) {
+ ["x"]=>
+ int(1)
+}
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
Modified: phpdoc/en/trunk/reference/mongo/versions.xml
===================================================================
--- phpdoc/en/trunk/reference/mongo/versions.xml 2009-08-27 22:28:23 UTC (rev 287823)
+++ phpdoc/en/trunk/reference/mongo/versions.xml 2009-08-27 22:50:20 UTC (rev 287824)
@@ -77,6 +77,9 @@
<function name='mongocursor::key' from='PECL mongo >=0.9.0'/>
<function name='mongocursor::count' from='PECL mongo >=0.9.2'/>
<function name='mongocursor::explain' from='PECL mongo >=0.9.2'/>
+ <function name='mongocursor::tailable' from='PECL mongo
>=0.9.4'/>
+ <function name='mongocursor::slaveokay' from='PECL mongo
>=0.9.4'/>
+ <function name='mongocursor::snapshot' from='PECL mongo
>=0.9.4'/>
<!-- MongoGridFS -->
<function name='mongogridfs::__construct' from='PECL mongo
>=0.9.0'/>
<function name='mongogridfs::find' from='PECL mongo >=0.9.0'/>