Fwd: Re: Delete all entries in a bucket?

Sean Cribbs seancribbs at gmail.com
Mon Feb 22 17:21:49 EST 2010

Reposting to the list.

-------- Original Message --------
Subject: 	Re: Delete all entries in a bucket?
Date: 	Mon, 22 Feb 2010 15:19:57 -0700
From: 	Sean Cribbs <seancribbs at gmail.com>
To: 	Dan Young <danoyoung at gmail.com>


With ripple, you can do something like this:

client = Riak::Client.new
bucket = client['my_bucket']
bucket.keys.each {|k| Riak::RObject.new(bucket, k).delete }

You could also pass that block to the 'keys' method on the bucket,
assuming you're not using the CurbBackend, which has some problems with
concurrency and curl-handle corruption.  Obviously this is not something
you want to do very often because it's expensive (N+1).


On 2/21/10 4:43 PM, Dan Young wrote:
>  Hello all,
>  I'm a newbie to Riak and am playing around with porting a mongodb
>  application to riak. Is there (I'm sure there is) a way to either
>  delete all the objects in a bucket or delete an entire bucket  and all
>  contained objects?  I'm using Ruby....
>  Regards,
>  Dan
>  _______________________________________________
>  riak-users mailing list
>  riak-users at lists.basho.com
>  http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20100222/e44df965/attachment.html>

More information about the riak-users mailing list