Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

Delete all data from Bucket using .Net SDK

4 replies [Last post]
  • Login or register to post comments
Wed, 12/12/2012 - 10:16
Vishal Batghare
Offline
Joined: 12/11/2012
Groups: None

Is there any way I can delete all data from bucket using .Net SDK.

Regards,
VB.

Top
  • Login or register to post comments
Wed, 12/12/2012 - 10:29
john
Offline
Joined: 01/05/2012
Groups: None

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

Top
  • Login or register to post comments
Wed, 12/12/2012 - 11:12
Vishal Batghare
Offline
Joined: 12/11/2012
Groups: None

which sdk lib/class has this class - CouchbaseCluster

Top
  • Login or register to post comments
Wed, 12/12/2012 - 12:09
john
Offline
Joined: 01/05/2012
Groups: None

Couchbase .NET Client 1.2.0 (released yesterday). It's under the Couchbase.Management namespace. I'll be writing docs for it soon...

Top
  • Login or register to post comments
Wed, 12/12/2012 - 12:48
Vishal Batghare
Offline
Joined: 12/11/2012
Groups: None

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",

});
}

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker