On Mar 28, 2014, at 8:59 AM, Nicolas Lapomarda <[email protected]> wrote:

> - Call -[CBLDocument purgeDocument:] on all the documents of the channel?

This.

> Note 1: I need the documents to be physically deleted from the device. They 
> contains large-ish attachments which we want gone.

Compact the database after purging, which will delete the attachments.

> Note 2: The use case also should allow the use to fetch those documents (and 
> attachments) again at a later time. (How?)

Create a new pull CBLReplication and set its documentIDs property to the 
document(s) you want to re-fetch.

(Actually there might be a problem with this the second time you try it -- the 
first time you run this replication it will fetch the docs, but then it will 
remember a checkpoint at the current sequence of the remote db. The second time 
you run it, it will only look at revisions newer than that checkpoint, so if 
those docs haven't changed they won't be replicated. Hm. What we need is an API 
to reset a replication by clearing its checkpoint.
A workaround is to add a bogus random doc ID to the array of doc IDs to fetch. 
This will cause the replication to have a different checkpoint ID every time.)

--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/2996704C-1A3D-49A8-B1D9-497F3BC94251%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to