Last active
August 29, 2015 13:56
-
-
Save philips/9097579 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This causes rethink to eat 100% cpu: | |
r.db('roller').table('app_event').groupedMapReduce( | |
r.js('(function(row) { return row.Version })'), | |
function(event) { return 1; }, | |
function(acc, count) { return acc.add(count); }, 0) | |
RqlRuntimeError: Cannot convert javascript `undefined` to ql::datum_t. in: | |
r.db("roller").table("app_event").groupedMapReduce(r.js("this.Version"), function(var_12) { return 1; }, function(var_13) { return var_13.add(var_14); }, {base: 0}) | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
r.db('roller').table('app_event').groupedMapReduce( | |
r.js('this.Version'), | |
function(event) { return 1; }, | |
function(acc, count) { return acc.add(count); }, 0) |
neumino
commented
Feb 19, 2014
By hour
r.db('roller').table('app_event').groupedMapReduce(
function(row) { return row("date").sub(row("date").minutes().mul(60)).sub(row("date").seconds()) }, // group by Version
function(row) { return 1 }, // map each document to 1
function(left, right) { return left.add(right) // Sum
).run(...)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment