Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 4 additions and 4 deletions.
  1. +3 −3 server/controller/mapreduce.php
  2. +1 −1 server/view/mapreduce.tpl
View
6 server/controller/mapreduce.php
@@ -108,19 +108,19 @@ public function after ()
// Set default values
if (!$this->params['query'])
{
- $this->params['query'] = '{ "event": " .. " }';
+ $this->params['query'] = '{ "event": "" }';
}
if (!$this->params['sort'])
{
$this->params['sort'] = '{ "value": -1 }';
}
if (!$this->params['map-func'])
{
- $this->params['map-func'] = "function () {\n \n}";
+ $this->params['map-func'] = "function () {\n emit(this.message, 1);\n}";
}
if (!$this->params['reduce-func'])
{
- $this->params['reduce-func'] = "function (key, obj) {\n \n}";
+ $this->params['reduce-func'] = "function (key, obj) {\n var sum = 0;\n for (var i in obj) {\n sum += obj[i];\n }\n return sum;\n}";
}
}
View
2 server/view/mapreduce.tpl
@@ -27,7 +27,7 @@
<table id="output" class="table table-condensed table-striped table-bordered">
<? foreach ($output as $row): ?>
<tr>
- <td width="100"><?=$row['_id']?></td>
+ <td width="50%"><?=htmlentities($row['_id'])?></td>
<td><?=$row['value']?></td>
</tr>
<? endforeach; ?>

No commit comments for this range

Something went wrong with that request. Please try again.