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

Using CAS with Views

1 reply [Last post]
  • Login or register to post comments
Fri, 02/10/2012 - 13:55
rrussell
Offline
Joined: 02/10/2012
Groups: None

We have the Developer Preview 3 installed, and we're using the couchbase-net-client-0.9.1.zip client library in C#.

Is it possible to retrieve CAS values when getting results from CouchbaseClient.GetView()? Our plan is to keep a client side cache that will store the CAS with the cached document. Then if the client changes that document and wants to commit it, we use the CAS value to ensure there aren't any conflicts. This is simple enough when using GetWithCas and passing keys, but I can't figure out how to do this when querying views.

On a somewhat unrelated subject, do documents have an internal timestamp or sequence number stored on the server side? We'd like to be able to write a view that only returns documents that have been modified after a certain date (or since a certain sequence number, like you can do with the _changes API for Couch DB).

Thanks in advance!
- Ryan

Top
  • Login or register to post comments
Mon, 02/13/2012 - 12:37
rrussell
Offline
Joined: 02/10/2012
Groups: None

The workaround we are currently using is to have the view only return the document keys, and then use CouchbaseClient.GetWithCas to get the documents with those keys. I'm not sure what the performance implications of this will be though.

However, it seems like the CouchbaseClient.Cas method doesn't work when we pass in a Cas value. CasResult is always false with status code 2, and the Cas value it returns is always 0. I found this thread, so I'm guessing it's the same problem :
http://www.couchbase.com/forums/thread/cas-result-statuscode

So a couple questions:
1) Is there an ETA on a fix for the Cas problem mentioned in the thread above?
2) Are there any plans to support getting Cas values when using CouchbaseClient.GetView()?

Cheers,
- Ryan

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