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

.NET Client Library - Remove with CAS

4 replies [Last post]
  • Login or register to post comments
Sat, 02/16/2013 - 06:11
mattds
Offline
Joined: 02/05/2013
Groups: None

Hi,

With regards to the .NET Client Library there doesn't appear to be an ExecuteRemove (or Remove) where a cas value can be specified, is removal conditional on a matching cas possible any other way?

Thanks,
Matt

Top
  • Login or register to post comments
Mon, 02/18/2013 - 11:44
john
Offline
Joined: 01/05/2012
Groups: None

Hi Mike,

This isn't possible with the .NET client and isn't available (as far as I know) in other SDKs. Could you describe the use case you're working with? How would your app react to a scenario where a delete were attempted against a stale document? Could you use CAS and update the key's value to null and then delete it after a successful CAS update?

-- John

Top
  • Login or register to post comments
Mon, 02/18/2013 - 13:04
mattds
Offline
Joined: 02/05/2013
Groups: None

Hi John,

I think the ruby SDK might have this function, on the Github wiki, it has the example c.delete("foo", :cas => 8835713818674332672). It's not essential but I would like to use it to clean up unused keys. The use case is storing a collection of values in a json array, where values are added or deleted. I would like to delete the item once the array count is zero - but only if no new items have been added since I determined there was only one remaining item that is being deleted.

Best Regards,
Matt

Top
  • Login or register to post comments
Tue, 02/19/2013 - 16:31
john
Offline
Joined: 01/05/2012
Groups: None

Hey Matt,

That was a pretty straightforward addition to the client, so I added it to the planned 1.2.2 release (March 5th). The Jira for the ticket is open at http://www.couchbase.com/issues/browse/NCBC-229. I updated our Enyim fork with those new methods and the unit tests are at http://review.couchbase.org/#/c/24713/1/src/Couchbase.Tests/CouchbaseCli.... The code is already written, it just has to go through code review.

-- John

Top
  • Login or register to post comments
Wed, 02/20/2013 - 00:21
mattds
Offline
Joined: 02/05/2013
Groups: None

Hi John,

That's awesome, many thanks.

Best Regards,
Matt

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