mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
snapshot and example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@287824 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
70c8cee058
commit
75b604c34a
2 changed files with 53 additions and 0 deletions
|
@ -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:
|
||||
|
|
|
@ -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'/>
|
||||
|
|
Loading…
Reference in a new issue