Delete all data from Bucket using .Net SDK
Is there any way I can delete all data from bucket using .Net SDK.
Regards,
VB.
which sdk lib/class has this class - CouchbaseCluster
Couchbase .NET Client 1.2.0 (released yesterday). It's under the Couchbase.Management namespace. I'll be writing docs for it soon...
got the new version of sdk and this is the code it does not work.
I am able to delete but able to create bucket.
What is AuthTypw Saala means and what is Sasalpassword. I know the bucket password and server password.
It gives me 401 unauthorized.
public void RemoveBucket()
{
//CouchbaseClient.FlushAll();
var cluster = new CouchbaseCluster(CouchbaseClientConfiguration);
cluster.DeleteBucket(CouchbaseClientConfiguration.Bucket);
cluster.CreateBucket(new Bucket
{
BucketType = BucketTypes.Membase,
Name = CouchConfig.BucketName,
Password = CouchConfig.BucketPassword,
AuthType = AuthTypes.Sasl,
Quota = new Quota{RAM = 512, RawRAM = 512},
SaslPassword ="Administrator",
});
}
Hi Vishal,
I'll be adding that feature to the CouchbaseCluster API in the near future. At this point, you would have to delete and recreate the bucket. That's a similar process to flushing a bucket, but it takes your design documents with you.
var cluster = new CouchbaseCluster("couchbase"); //config section cluster.DeleteBucket("bucketName"); cluster.CreateBucket(new Bucket { ... });-- jz