diff --git a/reference/mongo/datatypes.xml b/reference/mongo/datatypes.xml
deleted file mode 100644
index b7d715425e..0000000000
--- a/reference/mongo/datatypes.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/getquery.xml b/reference/mongo/mongocursor/getquery.xml
new file mode 100644
index 0000000000..4d203739ce
--- /dev/null
+++ b/reference/mongo/mongocursor/getquery.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+ MongoCursor::getQuery
+ Gets the query, fields, limit, and skip for this cursor
+
+
+
+ &reftitle.description;
+
+ public arrayMongoCursor::getQuery
+
+
+
+ This can be called before or after the query.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ The query, fields, limit, and skip for this cursor as an associative array.
+
+
+
+
+ &reftitle.examples;
+
+ MongoCursor::getQuery example
+
+foo->bar->find(array("x" => 4), array("y" => false));
+var_dump($cursor->getQuery());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(7) "foo.bar"
+ ["limit"]=>
+ int(0)
+ ["skip"]=>
+ int(0)
+ ["query"]=>
+ array(1) {
+ ["x"]=>
+ int(4)
+ }
+ ["fields"]=>
+ array(1) {
+ ["y"]=>
+ int(0)
+ }
+}
+]]>
+
+
+
+
+
+
diff --git a/reference/mongo/types.xml b/reference/mongo/types.xml
index 1fe356d330..abdfb42396 100644
--- a/reference/mongo/types.xml
+++ b/reference/mongo/types.xml
@@ -14,37 +14,6 @@
a half-dozen classes provided by the MongoDB PHP driver (for regular
expressions, dates, and other specialized applications).
-
- MongoDB uses a storage format called "BSON," Binary Serializable Object
- Notation, which is similar to JSON but more compact and rich in types. Listed
- below is the exact byte size of each type (or information required to compute
- its size, in the case of variable-length types). Keep in mind that these
- sizes do not include field names. The size of an object can be manually
- computed, but it may be easier for programmers to call the
- bson_encode function and take the length of the resulting
- string.
-
-
- An example of manually computing BSON size for saving the object
- array("x" => null, "y" => 40):
-
-
-
-
@@ -107,9 +76,9 @@
insert(array("scores" => $scores);
+// $scores will be saved as an array
+$scores = array(98, 100, 73, 85);
+$collection->insert(array("scores" => $scores);
// $scores will be saved as an object
$scores = array("quiz1" => 98, "midterm" => 100, "quiz2" => 73, "final" => 85);
@@ -181,13 +150,36 @@ $blog->insert($post2);
From the database shell, this will look something like:
- db.blog.find()
{ "_id" : ObjectId("4b06c263edb87a281e09dad8"), "author" : "Adam", "content" : "This is a blog post", "comments" : [ ], "date" : "Fri Nov 20 2009 11:22:59 GMT-0500 (EST)" }
{ "_id" : ObjectId("4b06c282edb87a281e09dad9"), "author" : { "name" : "Fred", "karma" : 42 }, "content" : "This is a blog post", "comments" : [ ], "date" : "Fri Nov 20 2009 11:23:30 GMT-0500 (EST)", "title" : "Second Post" }
]]>
+
+
+ The driver will not detect reference loops in arrays and objects. For
+ example, this will give a fatal error:
+
+insert($GLOBALS);
+
+?>
+]]>
+
+
+
+
+ If you need to insert documents that may have recursive dependency, you have
+ to check for it yourself before passing it to the driver.
+
@@ -321,6 +313,42 @@ $blog->insert($post2);
+
+
+ BSON
+
+ MongoDB uses a storage format called "BSON," Binary Serializable Object
+ Notation, which is similar to JSON but more compact and rich in types. Listed
+ below is the exact byte size of each type (or information required to compute
+ its size, in the case of variable-length types). Keep in mind that these
+ sizes do not include field names. The size of an object can be manually
+ computed, but it may be easier for programmers to call the
+ bson_encode function and take the length of the resulting
+ string.
+
+
+ An example of manually computing BSON size for saving the object
+ array("x" => null, "y" => 40):
+
+
+
+
+
+
&reference.mongo.mongoid;
diff --git a/reference/mongo/versions.xml b/reference/mongo/versions.xml
index 5ec02ccb35..e2cceb2c68 100644
--- a/reference/mongo/versions.xml
+++ b/reference/mongo/versions.xml
@@ -89,6 +89,7 @@
+