From 84c6f6bcf4abf083badfae16a9fa64acd20bdac0 Mon Sep 17 00:00:00 2001 From: Kristina Chodorow Date: Thu, 13 May 2010 18:31:22 +0000 Subject: [PATCH] added w & wtimeout doc git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@299357 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mongo/mongocollection.xml | 46 ++++++++++++++++ reference/mongo/mongodb.xml | 73 ++++++++++++++++++++++++++ reference/mongo/mongogridfs/remove.xml | 13 +---- 3 files changed, 120 insertions(+), 12 deletions(-) diff --git a/reference/mongo/mongocollection.xml b/reference/mongo/mongocollection.xml index 04bda48453..e914f642f1 100644 --- a/reference/mongo/mongocollection.xml +++ b/reference/mongo/mongocollection.xml @@ -50,6 +50,16 @@ db &null; + + public + integer + w + + + public + integer + wtimeout + &Methods; @@ -58,6 +68,42 @@ +
+ Fields + + + db + + + The "parent" database for this collection. + + + + + w + + + The number of servers to replicate a change to before returning success. + Value is inherited from the parent database. The + MongoDB class has a more detailed description of + how w works. + + + + + wtimeout + + + The number of milliseconds to wait for $this->w + replications to take place. Value is inherited from the parent database. + The MongoDB class has a more detailed description + of how wtimeout works. + + + + +
+
&reftitle.seealso; diff --git a/reference/mongo/mongodb.xml b/reference/mongo/mongodb.xml index f489f376ef..ee0e8f3bc3 100644 --- a/reference/mongo/mongodb.xml +++ b/reference/mongo/mongodb.xml @@ -71,6 +71,20 @@ $db = $m->selectDB("example"); 2 + Fields + + public + integer + w + 1 + + + public + integer + wtimeout + 10000 + + &Methods; @@ -115,6 +129,65 @@ $db = $m->selectDB("example");
+
+ Fields + + + w + 1 + + + The number of servers to replicate a change to before returning success. + Inherited by instances of MongoCollection derived + from this. w functionality is only available in + version 1.5.1+ of the MongoDB server and 1.0.8+ of the driver. + + + w is used whenever you perform a "safe" operation + (MongoCollection::insert, + MongoCollection::update, + MongoCollection::remove, + MongoCollection::save, and + MongoCollection::ensureIndex all support safe + options). With the default value (1), a safe operation will return once + the database server has the operation. If the server goes down before + the operation has been replicated to a slave, it is possible to lose the + operation forever. Thus, you can specify w to be + higher than one and guarantee that at least one slave has the operation + before it is considered successful. + + + For example, if w is 2, the main server and one slave + must have a record of the operation or the driver will throw a + MongoCursorException. It is tempting to set + w to the total number of slaves + master, but then if + one slave is down the op will fail and an exception will be thrown, so + usually w=2 is safest (master+1 slave). + + + + + wtimeout + 10000 + + + The number of milliseconds to wait for MongoDB::$w + replications to take place. Inherited by instances of + MongoCollection derived from this. + w functionality is only available in version 1.5.1+ of + the MongoDB server and 1.0.8+ of the driver. + + + Unless wtimeout is set, the server waits forever for + replicating to w servers to finish. The driver + defaults to waiting for 10 seconds, you can change this value to alter + its behavior. + + + + +
+
&reftitle.seealso; diff --git a/reference/mongo/mongogridfs/remove.xml b/reference/mongo/mongogridfs/remove.xml index 851cec320e..843e739499 100644 --- a/reference/mongo/mongogridfs/remove.xml +++ b/reference/mongo/mongogridfs/remove.xml @@ -12,7 +12,6 @@ public booleanMongoGridFS::remove arraycriteriaarray() - booleanjust_one&false; @@ -30,16 +29,6 @@ - - - just_one - - - - If only one matching file should be removed. - - - @@ -47,7 +36,7 @@ &reftitle.returnvalues; - Returns if the removal was successful. + Returns if the removal was successfully sent to the database.