Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should use the cas value #10

Open
janober opened this issue Feb 3, 2015 · 1 comment
Open

Should use the cas value #10

janober opened this issue Feb 3, 2015 · 1 comment

Comments

@janober
Copy link

janober commented Feb 3, 2015

This is related to #8. Where the cas is returned on document create with the id.

Like written there, the documents should always be exactly the same (no matter if query or create). However would be good if the cas would always be returned in for example "_cas", "_metadata.cas" or whatever. On save the connector should then use the cas when present to see if it matches with the current one and only update when they match. If not it should error with "cas mismatch" so that the application can change the data again based on the now current-document.

This is very important because there is no locking and data will else be overwritten all the time.

@janober
Copy link
Author

janober commented Feb 5, 2015

Started to implement it yesterday but did run into problems. Was unable to use the cas value which I queried from N1QL. The normal node-api returns an object with 2 values while N1QL returns only a number. After checking back with the Couchbase-Community it seems there is currently no solution for that but they logged it as a bug and fix it hopefully soon:
https://issues.couchbase.com/browse/JSCBC-196

Will finish my implementation once it is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant