Created
January 14, 2012 05:58
-
-
Save JackDanger/1610474 to your computer and use it in GitHub Desktop.
List all keys in Riak
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
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