Created
May 21, 2011 15:33
-
-
Save ncb000gt/984617 to your computer and use it in GitHub Desktop.
Remove all items from a bucket in riak with riak-js.
This file contains hidden or 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
| var db = require('riak-js').getClient({port: 8091}); | |
| console.log(process.argv); | |
| db.keys(process.argv[2], function(err, keys) { | |
| if (err) console.log(err); | |
| keys.forEach(function(key) { | |
| db.remove(process.argv[2], key, function(err) { | |
| if (err) console.log(err); | |
| console.log("Removed: " + key); | |
| }); | |
| }); | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Port is obviously custom and you'll get errors if you don't specify a third argument (which is the bucket name).