How to change channel of Pull Replication?



i am working with multiple channels . I need to change channel some times. But problem is that, i have to stop pull then set pull url and new channel & then start pull replication for get data using new channel .

Is there any option for create multiple replication object from same syncURL?


No, you need to stop the replication before changing channels.


Has any way to create multiple Replication object from same Database ?


Sure, just call the factory method again.


I have added channels for pull . But no documents found . I have called pullReplication with changeLintener . But didn’t get old documents . Only got which has changed . How i will get old documents which i didn’t emmit into Map first time ?


Have you pulled with that set of channels before? If you did, then the replication will pull the documents in those channels that have changed since the last time.

In other words, a plain replicator (no channels specified) has a separate state from a replicator with one set of channels, which has a separate state from a replicator with another set of channels.

If you call reset on a Replicator instance, it will clear its state and fetch everything. (But this will be slower.)


Can you please tell me how i reset Replication instance ? Do i set Replication instance null and then create again or else ?


Sorry, I just realized the reset functionality isn’t in the public API. But you shouldn’t need it.


HI, i want to delete document from local db of couchbase lite . How i will do this ? I don’t want to sync this deleted doc with server .


Use the purge method.