CouchDB leverages revision ids to assure a document nerver gets accidentally overwritten. On each update, the app logic must be aware of the previous revision id to update a document. Cradles .save() implementation completely disables this functionality, by automatically fetching the current documents revision id when a conflict occurs.
Removed automatic fetch of _rev if .save(); is tried on existing doc
Fixed the fix.
@indexzero Any opinion on this one? By the way, the documentation also states that the _rev is need to update a single doc. Right now, this is not the case...
@indexzero @cloudhead Ping.
This issue came up for us today as well. Would be interested to hear rationale for this approach before I create a workaround on our end.
This needs to be an option enabled by default. It's one of the reasons cradle is a "high-level" library for CouchDB and not "a literal and fraglie" library for CouchDB.
Okay, now at least there's an explanation for cradles behavior.
But - and it's a huge but - as it clearly breaks the way how saving documents are meant to work in CouchDB you really have to address this in your README in a prominent way. Even with an option that defaults to to the current way you have to be absolutely clear about that cradle is not acting like what you expect from CouchDB here.
Just stubbed my toe on this as well. This behaviour is totally 'un-CouchDB'. :(
Is this behavior configurable? I just wasted good deal of time with this problem
We're all free to add this config option (fork and create a pull request); I'll open one in the next couple days unless one of you does first.