Hi Jens, Thank you for your reply.
(if I recall correctly) CouchDB doesn't digest the JSON but rather the > serialized Erlang term that represents it; yeah, in this case it will be impossible to generate rev same as in couchdb. I do understand that this is quite a rare use-case, but I just got it randomly and was wandering if I'm doing something wrong. Anyways, thanks again! - Igor Le mardi 14 octobre 2014 01:12:22 UTC+2, Jens Alfke a écrit : > > > On Oct 13, 2014, at 12:22 PM, Igor Ievsiukov <[email protected] > <javascript:>> wrote: > > I've noticed that having the same doc _id and content, Apache CouchDB and > CouchBase Lite are generating different revision hashes. > > > This is true, but it's not really a problem. > > a) revision is a MD5 of a document and its' attachments; which are > identical here > > > It's actually generated from the parent rev ID, the 'deleted' flag, and > the JSON. But there are a lot of different ways to encode this information > before generating an MD5, and CBL and CouchDB don't do it identically. In > particular, (if I recall correctly) CouchDB doesn't digest the JSON but > rather the serialized Erlang term that represents it; that's something CBL > couldn't practically reproduce, so I didn't even try. > > b) replication will be messed up: we will have a conflict where it > shouldn't be > > > This only happens in the case where two clients (one CBL, one CouchDB) > make the exact same change to the same parent revision. The revisions they > create will have identical contents but different revision IDs. This will > be a conflict but one that's trivial to resolve. Note that one of those two > revisions has to be created *by CouchDB itself*, i.e. by a direct PUT to > CouchDB's REST API, not just using CouchDB as a replication server. > > —Jens > -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/673077fa-9b63-493d-a689-11467bbef6a2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
