Skip to content

Instantly share code, notes, and snippets.

@tomz
Last active December 14, 2015 12:38
Show Gist options
  • Save tomz/5087598 to your computer and use it in GitHub Desktop.
Save tomz/5087598 to your computer and use it in GitHub Desktop.
relatively efficient way to empty a bucket in Riak - using streaming API
# relatively efficient way to empty a bucket in Riak
def empty_bucket bucket_name
bucket = Riak.bucket(bucket_name)
bucket.keys do |keys|
keys.each do |key|
bucket.delete(key)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment