pulling back purged docs

29 views
Skip to first unread message

Seung Chan Lim

unread,
Sep 26, 2014, 10:40:24 AM9/26/14
to mobile-c...@googlegroups.com
Hi,

I'm trying to implement some purging into my phonegap app on iOS. The local db is getting big. 

If I purge the docs, what's the best practice for later getting them back? (i.e. get them re-replicated from the sync gateway?)

slim

Jens Alfke

unread,
Sep 26, 2014, 11:36:03 AM9/26/14
to mobile-c...@googlegroups.com

On Sep 26, 2014, at 7:40 AM, Seung Chan Lim <djs...@gmail.com> wrote:

If I purge the docs, what's the best practice for later getting them back? (i.e. get them re-replicated from the sync gateway?)

In 1.0.2 it's a bit awkward; you'll need to create a new pull replication and set its documentIDs property.

There is a branch feature/subset that makes this easier by adding a method -[CBLReplication pullDocumentIDs:] so you can ask an existing pull replication to bring in any documents you want. (Disclaimer: it hasn't been tested much yet.)

—Jens

Seung Chan Lim

unread,
Sep 26, 2014, 12:16:45 PM9/26/14
to mobile-c...@googlegroups.com
I'm on phonegap. Could you translate what you mean when you say "set its documentIDS property" ?

 Is there an attribute (i.e. "document_ids") to pass along with "source," "target," "continuous" and those? And populate it with a JSON stringified arrary of doc ids?

slim 

Jens Alfke

unread,
Sep 26, 2014, 12:25:41 PM9/26/14
to mobile-c...@googlegroups.com

On Sep 26, 2014, at 9:16 AM, Seung Chan Lim <djs...@gmail.com> wrote:

I'm on phonegap. Could you translate what you mean when you say "set its documentIDS property" ?

I was going to point you at the REST API docs for /_replicate, but I see that they're missing many of the message body properties. *facepalm*

The JSON property to set in the body of the /_replicate request is "doc_ids". Its value is an array of strings.

/me goes off to file a bug report against the docs

—Jens
Reply all
Reply to author
Forward
0 new messages