Skip to content

Instantly share code, notes, and snippets.

@philips
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philips/9062295 to your computer and use it in GitHub Desktop.
Save philips/9062295 to your computer and use it in GitHub Desktop.
r.db('roller').table('app_event').filter(function(event) {
return event("DateTime").minutes().eq(15);
}).count
Return 52
r.db('roller').table('app_event').groupedMapReduce(
function(event) { return event('DateTime').minutes(); },
function(event) { return 1; },
function(acc, event) { acc.add(1); return acc; }, r.expr(0))
All groups are 0
r.db('roller').table('app_event').groupedMapReduce(
function(event) { return event('DateTime').minutes(); },
function(event) { return 1; },
function(acc, event) { return acc.add(1); }, 0)
[{"reduction":1,"group":15},{"reduction":1,"group":19},{"reduction":1,"group":20},{"reduction":1,"group":21},{"reduction":1,"group":22},{"reduction":1,"group":23},{"reduction":1,"group":24},{"reduction":1,"group":25},{"reduction":1,"group":26},{"reduction":1,"group":27},{"reduction":1,"group":28},{"reduction":1,"group":29},{"reduction":1,"group":30},{"reduction":1,"group":31},{"reduction":1,"group":32},{"reduction":1,"group":33},{"reduction":1,"group":34},{"reduction":1,"group":35},{"reduction":1,"group":36},{"reduction":1,"group":37},{"reduction":1,"group":38},{"reduction":1,"group":39},{"reduction":1,"group":40},{"reduction":1,"group":41},{"reduction":1,"group":42},{"reduction":1,"group":43},{"reduction":1,"group":44},{"reduction":1,"group":45},{"reduction":1,"group":46}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment