From e1dd919618d95aee6c379b435f235f4a45fdebed Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Thu, 29 Dec 2011 11:48:33 +0000 Subject: [PATCH] Documentation fixes and changes for 1.3.0. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@321505 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../mongo/mongocollection/ensureindex.xml | 46 +++++++++++++------ reference/mongo/mongocollection/insert.xml | 8 ++++ reference/mongo/mongocollection/remove.xml | 8 ++++ reference/mongo/mongocollection/update.xml | 8 ++++ reference/mongo/mongocursor/sort.xml | 26 +++++++++++ 5 files changed, 82 insertions(+), 14 deletions(-) diff --git a/reference/mongo/mongocollection/ensureindex.xml b/reference/mongo/mongocollection/ensureindex.xml index 60538c0232..9a9fc9200c 100644 --- a/reference/mongo/mongocollection/ensureindex.xml +++ b/reference/mongo/mongocollection/ensureindex.xml @@ -14,13 +14,13 @@ &reftitle.description; public boolMongoCollection::ensureIndex - arraykeys + string|arraykey|keys arrayoptionsarray() - A unique index cannot be created on a field if multiple existing documents do - not contain the field. The field is effectively &null; for these documents - and thus already non-unique. + This method creates an index on the collection and the specified fields. + The key specification can either be just a single field name as string, or an + array containing one or more field names with their sort direction. @@ -55,6 +55,13 @@ Create a unique index. + + + A unique index cannot be created on a field if multiple existing documents do + not contain the field. The field is effectively &null; for these documents + and thus already non-unique. + + @@ -103,9 +110,9 @@ "name" - After driver version 1.0.4 (NOT including 1.0.4) you can specify an - index name. This can be useful if you are indexing many keys and - Mongo complains about the index name being too long. + Starting with driver version 1.0.5 you can specify an index name. + This can be useful if you are indexing many keys and Mongo complains + about the index name being too long. @@ -148,9 +155,11 @@ - 1.2.0 + 1.0.2 - Added timeout option. + Changed "options" parameter from boolean to array. Pre-1.0.2, the + second parameter was an optional boolean value specifying a unique + index. @@ -167,11 +176,17 @@ - 1.0.2 + 1.2.0 - Changed "options" parameter from boolean to array. Pre-1.0.2, the - second parameter was an optional boolean value specifying a unique - index. + Added timeout option. + + + + 1.3.0 + + The options parameter does no longer accept + just a boolean to signify a unique index. Instead, this now has to be done + with array('unique' => true). @@ -209,7 +224,10 @@ $c = new MongoCollection($db, 'foo'); // create an index on 'x' ascending -$c->ensureIndex(array('x' => 1)); +$c->ensureIndex('x'); + +// create an index on 'y' ascending +$c->ensureIndex(array('y' => 1)); // create an index on 'z' ascending and 'zz' descending $c->ensureIndex(array('z' => 1, 'zz' => -1)); diff --git a/reference/mongo/mongocollection/insert.xml b/reference/mongo/mongocollection/insert.xml index 21a5ea2bb2..93758a8a98 100644 --- a/reference/mongo/mongocollection/insert.xml +++ b/reference/mongo/mongocollection/insert.xml @@ -291,6 +291,14 @@ Added timeout option. + + 1.3.0 + + The options parameter does no longer accept + just a boolean to signify a safe insert. Instead, this now has to be done + with array('safe' => true). + + diff --git a/reference/mongo/mongocollection/remove.xml b/reference/mongo/mongocollection/remove.xml index 86fa485d3a..9e28da339e 100644 --- a/reference/mongo/mongocollection/remove.xml +++ b/reference/mongo/mongocollection/remove.xml @@ -178,6 +178,14 @@ Added timeout option. + + 1.3.0 + + The options parameter does no longer accept + just a boolean to signify "justOne". Instead, this now has to be done + with array('justOne' => true). + + diff --git a/reference/mongo/mongocollection/update.xml b/reference/mongo/mongocollection/update.xml index 1d052dd31d..abf4344055 100644 --- a/reference/mongo/mongocollection/update.xml +++ b/reference/mongo/mongocollection/update.xml @@ -211,6 +211,14 @@ Added timeout option. + + 1.3.0 + + The options parameter does no longer accept + just a boolean to signify an upsert. Instead, this now has to be done + with array('upsert' => true). + + diff --git a/reference/mongo/mongocursor/sort.xml b/reference/mongo/mongocursor/sort.xml index 80151acb3f..5af1c92fc8 100644 --- a/reference/mongo/mongocursor/sort.xml +++ b/reference/mongo/mongocursor/sort.xml @@ -47,6 +47,32 @@ + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 1.3.0 + + The options parameter does no longer accept + just a boolean to signify a safe insert. Instead, this now has to be done + with array('safe' => true). + + + + + + + + &reftitle.examples;