diff --git a/reference/mongo/mongocollection/remove.xml b/reference/mongo/mongocollection/remove.xml index 1b08eafea5..fe15274892 100644 --- a/reference/mongo/mongocollection/remove.xml +++ b/reference/mongo/mongocollection/remove.xml @@ -20,7 +20,7 @@ &reftitle.parameters; - + criteria @@ -40,7 +40,7 @@ include: &mongo.writes.parameters.writeconcern; - + "justOne" diff --git a/reference/mongo/mongocollection/update.xml b/reference/mongo/mongocollection/update.xml index 18b8972352..a91d219b6b 100644 --- a/reference/mongo/mongocollection/update.xml +++ b/reference/mongo/mongocollection/update.xml @@ -31,7 +31,7 @@ - + new_object @@ -52,7 +52,7 @@ An array of options for the update operation. Currently available options include: - + "upsert" @@ -70,7 +70,7 @@ document. See the upsert examples below for more information. - + "multiple" diff --git a/reference/mongo/mongowritebatch/add.xml b/reference/mongo/mongowritebatch/add.xml index a02d24cd20..61da6b8c65 100644 --- a/reference/mongo/mongowritebatch/add.xml +++ b/reference/mongo/mongowritebatch/add.xml @@ -4,7 +4,7 @@ MongoWriteBatch::add - Adds an CRUD operation to a batch + Adds a write operation to a batch @@ -14,14 +14,15 @@ arrayitem - The operation to add to the batch. + Adds a write operation to the batch. - If $item causes the batch to hit the maxWriteBatchSize - or maxBsonObjectSize limits, a new batch will be created internally and - the batches batched up and sent one at a time upon calling MongoWriteBatch::execute. + If $item causes the batch to exceed the + maxWriteBatchSize + or maxBsonObjectSize + limits, the driver will internally split the batches into multiple write + commands upon calling MongoWriteBatch::execute. - @@ -31,30 +32,36 @@ item + An array that describes a write operation. The structure of this value + depends on the batch's operation type. - When current batch is + Batch type Argument expectation - MongoWriteBatch::COMMAND_INSERT - The document to add - - - MongoWriteBatch::COMMAND_UPDATE + MongoWriteBatch::COMMAND_INSERT - Raw update operation. Required keys are: array("q" => array("criteria"), "u" => array("new data")) - Optionally with the "multi" and "upsert" keys as boolean values - "upsert": If set to true, creates a new document when no document matches the query criteria. The default value is false, which does not insert a new document when no match is found. + The document to add. - MongoWriteBatch::COMMAND_DELETE + MongoWriteBatch::COMMAND_UPDATE - Raw delete operation. Required keys are: array("q" => array("criteria"), "limit" => 1) + Raw update operation. + Required keys are "q" and "u", which correspond to the $criteria and $new_object parameters of MongoCollection::update, respectively. + Optional keys are "multi" and "upsert", which correspond to the "multiple" and "upsert" options for MongoCollection::update, respectively. If unspecified, both options default to &false;. + + + + MongoWriteBatch::COMMAND_DELETE + + Raw delete operation. + Required keys are: "q" and "limit", which correspond to the $criteria parameter and "justOne" option of MongoCollection::remove, respectively. + The "limit" option is an integer; however, MongoDB only supports 0 (i.e. remove all matching documents) and 1 (i.e. remove at most one matching document) at this time. @@ -68,7 +75,7 @@ &reftitle.returnvalues; - Returns &true; on success, throws exception on failure. + Returns &true; on success and throws an exception on failure.