> On Sep 13, 2014, at 1:52 AM, Rajagopal V <[email protected]> wrote:
> 
> I have a continuous replication that brings some specified "types" of 
> documents. Now when the user does a Search on his mobile for other "types", 
> there is a REST call that goes to my PHP server that returns document ids 
> back to the mobile(these are not yet available in the mobile). If I were to 
> do a one-shot pull replication using the returned ids, I assume that those 
> will be available in the mobile and subsequently be replicated continuously 
> when I update them through the mobile. 

In 1.0.2 the answer is no; a one-shot replication will only update the 
documents once. To keep all the docs you've pulled fresh, you'll have to keep 
track of all of their IDs (persistently) and run a continuous pull replication 
with those doc IDs.

Now, on the iOS branch feature/subset I've added a couple of new methods on 
CBLReplication 
<https://github.com/couchbase/couchbase-lite-ios/blob/feature/subset/Source/API/CBLReplication.h>
 to make what you're doing easier:

-createQueryOfRemoteView: returns a CBLQuery that will access a view on the 
server. And if you get the .document property of any of the returned query 
rows, that document will be pulled asynchronously. (So be prepared for it to 
have no properties initially, until the download completes.) Note: This works 
with CouchDB and Cloudant, but to use it with Sync Gateway you need to build 
its feature/query_api branch.
-pullDocumentIDs: will immediately pull the documents with the given IDs.
Setting a pull replication's .customProperties property to @{@"add_docs": @NO} 
will prevent that replication from adding documents to the local database. So 
if you run a continuous replication with this property, but no filters or 
docIDs, it will keep all the docs you've downloaded in sync (which is what you 
asked for above.)

Of course this is experimental, we haven't committed to ship it, the API might 
change, etc. But I'd love for people to try it and give feedback.

—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/2B1B6CB2-83BB-4AF5-B81F-E16A3D300CB3%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to