mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
added note on mapreduce scoping
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@295181 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
62c1bb2619
commit
9f2a09bdbf
2 changed files with 21 additions and 3 deletions
|
@ -78,6 +78,13 @@ while ($halflife > 0) {
|
|||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
MongoDB core docs on <link xlink:href="&url.mongodb.dochub.remove;">remove</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -86,7 +86,7 @@ foreach ($ages['values'] as $age) {
|
|||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title><function>MongoDB::command</function> map/reduce example</title>
|
||||
<title><function>MongoDB::command</function> MapReduce example</title>
|
||||
<para>
|
||||
Get all users with at least on "sale" event, and how many times each
|
||||
of these users has had a sale.
|
||||
|
@ -131,6 +131,18 @@ User 47cc67093475061e3d9536d2 had 3 sale(s).
|
|||
User 49902cde5162504500b45c2c had 14 sale(s).
|
||||
User 4af467e4fd543cce7b0ea8e2 had 1 sale(s).
|
||||
</screen>
|
||||
<note>
|
||||
<title>Using <classname>MongoCode</classname></title>
|
||||
<para>
|
||||
This example uses <classname>MongoCode</classname>, which can also take a
|
||||
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.
|
||||
</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
|
||||
|
@ -146,8 +158,7 @@ User 4af467e4fd543cce7b0ea8e2 had 1 sale(s).
|
|||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
MongoDB core docs on <link xlink:href="&url.mongodb.dochub.commands;">database commands</link>
|
||||
and <link xlink:href="&url.mongodb.dochub.mapreduce;">MapReduce</link>.
|
||||
MongoDB core docs on <link xlink:href="&url.mongodb.dochub.commands;">database commands</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
Loading…
Reference in a new issue