Skip to content

Instantly share code, notes, and snippets.

@JackDanger
Created January 14, 2012 05:58
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 JackDanger/1610474 to your computer and use it in GitHub Desktop.
Save JackDanger/1610474 to your computer and use it in GitHub Desktop.
List all keys in Riak
curl -s $riak/$bucket?keys=stream | `which ruby` -rubygems -e "gem 'yajl-ruby'; require 'yajl'; Yajl::Parser.parse(STDIN) {|set| set['keys'] && set['keys'].each {|key| puts key } }"
# Delete them all:
# curl -s $riak/$bucket?keys=stream | `which ruby` -rubygems -e "gem 'yajl-ruby'; require 'riak'; require 'yajl'; riak = Riak::Client.new; bucket = riak.bucket('$bucket'); Yajl::Parser.parse(STDIN) {|set| set['keys'] && set['keys'].each {|key| p bucket.delete(key) } }"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment