Skip to content

Instantly share code, notes, and snippets.

@johnthethird
Created March 19, 2010 16:46
Show Gist options
  • Select an option

  • Save johnthethird/337799 to your computer and use it in GitHub Desktop.

Select an option

Save johnthethird/337799 to your computer and use it in GitHub Desktop.
# Riak / Ripple code to use a regex to find keys
results = Riak::MapReduce.new(client)
.add("my_bucket")
.map("function(value,keyData,arg) {
var re = new RegExp(arg);
return value.key.match(re) ? [value.key] : [];
}", :keep => true, :arg => "^foo").run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment