svn: /phpdoc/en/trunk/reference/mongo/mongocollection/ save.xml

From: Date: Thu, 29 Nov 2012 00:51:28 +0000
Subject: svn: /phpdoc/en/trunk/reference/mongo/mongocollection/ save.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-10804@lists.php.net to get a copy of this message
bjori Thu, 29 Nov 2012 00:51:28 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=328551 Log: Mention we populate the _id field with the pregenerated ID Changed paths: U phpdoc/en/trunk/reference/mongo/mongocollection/save.xml Modified: phpdoc/en/trunk/reference/mongo/mongocollection/save.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/mongocollection/save.xml 2012-11-29 00:16:49 UTC (rev 328550) +++ phpdoc/en/trunk/reference/mongo/mongocollection/save.xml 2012-11-29 00:51:28 UTC (rev 328551) @@ -124,6 +124,7 @@ // insert $obj into the db $collection->save($obj); +var_dump($obj); // add another field $obj['foo'] = 'bar'; @@ -137,9 +138,34 @@ ?> ]]> </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +array(2) { + ["x"]=> + int(1) + ["_id"]=> + object(MongoId)#4 (1) { + ["$id"]=> + string(24) "50b6afe544415ed606000000" + } +} +]]> + </screen> </example> </refsect1> + <refsect1 role="notes"><!-- {{{ --> + &reftitle.notes; + <note> + <para> + This method will create an <literal>_id</literal> field in the + <parameter>a</parameter> array with a pregenerated ID if the field didn't + exist already - unless the argument was a reference. + </para> + </note> + </refsect1><!-- }}} --> + </refentry> <!-- Keep this comment at the end of the file Local variables:

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