svn: /phpdoc/en/trunk/reference/mongo/mongocollection/ save.xml
| From: | Kristina Chodorow | Date: | Wed, 28 Jul 2010 20:11:23 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/mongo/mongocollection/ save.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6939@lists.php.net to get a copy of this message | ||
kristina Wed, 28 Jul 2010 20:11:23 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=301669
Log:
added fsync & safe options
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 2010-07-28 19:58:31 UTC (rev 301668)
+++ phpdoc/en/trunk/reference/mongo/mongocollection/save.xml 2010-07-28 20:11:23 UTC (rev 301669)
@@ -47,9 +47,29 @@
<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>
</para>
</listitem>
@@ -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>