mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Mention we populate the _id field with the pregenerated ID
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328551 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
8bbdbb8d6b
commit
48e1717a75
1 changed files with 26 additions and 0 deletions
|
@ -124,6 +124,7 @@ $obj = array('x' => 1);
|
|||
|
||||
// insert $obj into the db
|
||||
$collection->save($obj);
|
||||
var_dump($obj);
|
||||
|
||||
// add another field
|
||||
$obj['foo'] = 'bar';
|
||||
|
@ -137,9 +138,34 @@ $collection->save($obj);
|
|||
?>
|
||||
]]>
|
||||
</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:
|
||||
|
|
Loading…
Reference in a new issue