mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
added fsync & safe options
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@301669 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
b826063685
commit
d0935fe66d
1 changed files with 36 additions and 2 deletions
|
@ -47,7 +47,27 @@
|
|||
<literal>"safe"</literal>
|
||||
</para>
|
||||
<para>
|
||||
Check that the save succeeded.
|
||||
Can be a boolean or integer, defaults to &false;. If &false;, the
|
||||
program continues executing without waiting for a database response.
|
||||
If &true;, the program will wait for the database response and throw a
|
||||
<classname>MongoCursorException</classname> if the insert did not
|
||||
succeed.
|
||||
</para>
|
||||
<para>
|
||||
If <literal>safe</literal> is an integer, will replicate the
|
||||
insert to that many machines before returning success (or throw an
|
||||
exception if the replication times out, see wtimeout). This overrides
|
||||
the w variable set on the collection.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>"fsync"</literal>
|
||||
</para>
|
||||
<para>
|
||||
Boolean, defaults to &false;. Forces the insert to be synced to
|
||||
disk before returning success. If &true;, a safe insert is implied
|
||||
and will override setting <literal>safe</literal> to &false;.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
@ -61,7 +81,9 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns if the object was saved.
|
||||
If <parameter>safe</parameter> was set, returns an array containing the status of the save.
|
||||
Otherwise, returns a boolean representing if the array was not empty (an empty array will not
|
||||
be inserted).
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -71,6 +93,11 @@
|
|||
Throws <classname>MongoCursorException</classname> if the "safe" option is
|
||||
set and the save fails.
|
||||
</para>
|
||||
<para>
|
||||
Throws <classname>MongoCursorTimeoutException</classname> if the "safe"
|
||||
option is set to a value greater than one and the database cannot replicate
|
||||
the operation in <literal>MongoCollection::$wtimeout</literal> milliseconds.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
|
@ -91,6 +118,13 @@
|
|||
Added "options" parameter.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.0.9</entry>
|
||||
<entry>
|
||||
Added ability to pass integers to "safe" options (only accepted booleans
|
||||
before) and added "fsync" option.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
Loading…
Reference in a new issue