Replicate Lookup Documents on intial launch in Couchbase Lite


#1

Hi,

  • I have some lookup documents, what is the best way to automatically sync few lookup documents, i mean, is it possible to give a priority to the documents, which documents will synch first among other documents.
  • My application have login screen, so i want to query for login, can we get sync all my documents on app launch. or else have to use REST API call for like these scenarios.

Please advice me, what is the best ways for above requirements.


#2

You can use channel based filtering with Sync Gateway replications http://developer.couchbase.com/documentation/mobile/1.1.0/develop/guides/couchbase-lite/native-api/replication/index.html#filtered_pull

There is an open ticket to add replication filters based on document IDs that you could upvote https://github.com/couchbase/sync_gateway/issues/545

James


#3

@jamiltz, thanks for reply, My application have login screen, so i want to query for login, can we get sync all my user documents on app launch. or else have to use REST API call for like these scenarios.

is it possible to give a priories on documents for synch replications.


#4

You can query documents with a particular id with the Sync Gateway REST api http://developer.couchbase.com/documentation/mobile/1.1.0/develop/references/sync-gateway/rest-api/database/post-bulk-get/index.html


#5

Thank you i will check it.