svn: /phpdoc/en/trunk/reference/mongo/mongodb/ command.xml
| From: | Kristina Chodorow | Date: | Thu, 07 Apr 2011 21:42:59 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/mongo/mongodb/ command.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-7931@lists.php.net to get a copy of this message | ||
kristina Thu, 07 Apr 2011 21:42:59 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=310025
Log:
added out option
Changed paths:
U phpdoc/en/trunk/reference/mongo/mongodb/command.xml
Modified: phpdoc/en/trunk/reference/mongo/mongodb/command.xml
===================================================================
--- phpdoc/en/trunk/reference/mongo/mongodb/command.xml 2011-04-07 21:39:16 UTC (rev 310024)
+++ phpdoc/en/trunk/reference/mongo/mongodb/command.xml 2011-04-07 21:42:59 UTC (rev 310025)
@@ -144,7 +144,8 @@
"mapreduce" => "events",
"map" => $map,
"reduce" => $reduce,
- "query" => array("type" => "sale")));
+ "query" => array("type" => "sale"),
+ "out" => array("merge" => "eventCounts")));
$users = $db->selectCollection($sales['result'])->find();
@@ -168,11 +169,22 @@
scope argument. However, at the moment, MongoDB does not support using
scopes in MapReduce. If you would like to use client-side variables in the
MapReduce functions, you can add them to the global scope by using the
- optional scope field with the database command. See
- <link xlink:href="&url.mongodb.dochub.mapreduce;">MapReduce</link>
for more
- information.
+ optional scope field with the database command. See the
+ <link xlink:href="&url.mongodb.dochub.mapreduce;">MapReduce
documentation</link>
+ for more information.
</para>
</note>
+ <note>
+ <title>The <literal>out</literal> argument</title>
+ <para>
+ Before 1.8.0, the <literal>out</literal> argument was optional. If you did
+ not use it, MapReduce results would be written to a temporary collection,
+ which would be deleted when your connection was closed. In 1.8.0+, the
+ <literal>out</literal> argument is required. See the
+ <link xlink:href="&url.mongodb.dochub.mapreduce;">MapReduce
documentation</link>
+ for more information.
+ </para>
+ </note>
<para>
If you are going to be using MapReduce, Prajwal Tuladhar created an API for
Mongo PHP users which provides a nicer interface than the bare command. You