From 75b604c34aaf61a4befa23d495c9a02483cb2132 Mon Sep 17 00:00:00 2001 From: Kristina Chodorow Date: Thu, 27 Aug 2009 22:50:20 +0000 Subject: [PATCH] snapshot and example git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@287824 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mongo/mongocollection/insert.xml | 50 ++++++++++++++++++++++ reference/mongo/versions.xml | 3 ++ 2 files changed, 53 insertions(+) diff --git a/reference/mongo/mongocollection/insert.xml b/reference/mongo/mongocollection/insert.xml index f004bea770..2a089f3712 100644 --- a/reference/mongo/mongocollection/insert.xml +++ b/reference/mongo/mongocollection/insert.xml @@ -39,6 +39,56 @@ Returns if the array was not empty (an empty array will not be inserted). + + + &reftitle.returnvalues; + + Returns if the arrays were saved. + + + + + &reftitle.examples; + + <function>MongoCollection::insert</function> _id example + + Inserting an object will add an _id field to it, unless it is passed by reference. + + + 1); +$collection->insert($a); +var_dump($a) + +$b = array('x' => 1); +$ref = &$b; +$collection->insert($ref); +var_dump($ref); + +?> +]]> + + &example.outputs.similar; + + + int(1) + ["_id"]=> + object(MongoId)#4 (0) { + } +} +array(1) { + ["x"]=> + int(1) +} +]]> + + + +