Using CAS with Views
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
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