Skip to content

Instantly share code, notes, and snippets.

@tovbinm
Created March 5, 2012 18:41
Show Gist options
  • Save tovbinm/1980242 to your computer and use it in GitHub Desktop.
Save tovbinm/1980242 to your computer and use it in GitHub Desktop.
Using riak-js
Setup:
npm install riak-js@latest
Usage:
node -e "require('riak-js').getClient({ host: 'hostname', port: 8098 }).count('bucket');"
(More here: https://github.com/frank06/riak-js)
var c = require('riak-js').getClient({ host: 'hostname', port: 8098 });
var mr = c.add('bucket').map(function m(v){return [1]}).reduce(function(v) { return [v.reduce(function(t, val) { return t + val; }, 0)]});
mr.run({timeout: 10000000});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment