Open xavierchow opened 2 years ago
@gsi-alejandro can you please address this, I think we dont have this as a feature today like @xavierchow had mentioned. Is there a limitation as to not exposing the getOptions ?
@AV25242
I think we can expose it, no problem.
Next release we plan to expose a way to return the CAS value when available.
@gsi-alejandro hey, any updates about this?
+1
@gsi-alejandro where are we on this ? cc @ejscribner @thejcfactor
another solution is:
IDocument
hold the CAS
as its internal dataIDocument.save()
method to enable CAS
check when updatingtherefore SDK user won't explicitly use the CAS
at all.
As one of the approaches to concurrency-safe mutating document, I need to get the CAS from the document and replace the doc with it.
I didn't find a documentation about the CAS retrieving, digging into the code it seems the
findById
only gets back thevalue
(that is replaced by content according to latest sdk) https://github.com/couchbaselabs/node-ottoman/blob/d8a4936ed996526735bae3fca478fda1516d582c/src/model/create-model.ts#L190-L192Will it be a good idea to have the ottoman to support both query CAS and update with it? my two cents,
FindByIdOptions
to allow querying the CASupdateById
to allow passing a CAS(probably viaMutationFunctionOptions
)?