> On Mar 17, 2015, at 6:42 AM, Vinay Bhinde <[email protected]> wrote:
> 
> - on device B what i do is get all the x docs from my server and issue a PUT 
> request with rev id present in each docs
> - this gives me 404 error as the db on device B is blank and hence it wont 
> accept docs with revision id's because it won't be able to find older 
> revisions which is correct.

Add “?new_edits=false” to the URL of the PUT. This tells CBL that you’re 
inserting an existing revision instead of creating a new one. (This is the same 
flag used by the replicator.)

Also, if you want the replicator to work properly with these documents (i.e. to 
not get confused if it later pulls the same document from a server) you should 
insert the complete revision history along with the document. To do that, when 
you GET the document from the remote server, add “?revs=true” to the URL. That 
will add a “_revisions” property to the document containing the list of 
ancestor revision IDs. When you PUT this document, CBL will detect the 
“_revisions” property and use it to recreate the doc’s revision history.

—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/8F5B13AA-FB00-49E8-8C2A-2DF64499DADF%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to