Is it possible to determine if particular type of documents get synced completely?

12 views
Skip to first unread message

parvez....@decurtis.com

unread,
May 31, 2017, 10:42:23 AM5/31/17
to Couchbase Mobile
Is it possible to check if all documents of a particular type for example type == "someDoc" are synced to an iOS client? The requirement here is that we need to collect all documents of a particular type and need to share their information to UI on iOS application once these are all available at iOS end. Lets suppose there are 10 documents (though count is not exactly known) with type == "someDocs" that need to get synced completely and once done we need to update UI that all documents are available at local end now.

Priya R

unread,
May 31, 2017, 12:51:22 PM5/31/17
to Couchbase Mobile

Hi

If the documents of specific type can be assigned to a specific channel, you could set a filtered replicator to download documents based on the specific channel  and then monitor the replicationStatus to see if it’s done. That said, I am not entirely sure what you meant by "synced completely" - I would expect that the documents could get added/updated at any point so it is likely that document changes could be synching to the iOS app even when the UI is presenting the current set - In other words, your app should be prepared to update the UI with changes to the documents as they come in using a liveQuery (Ref: CBLLiveQuery) 

Reply all
Reply to author
Forward
0 new messages