Filtered pull notification in Phonegap



We are replicating specific channels in Android with the next code:

URL url = new URL(“”);
List channels = new ArrayList();

Everything works fine, we acan do specific push and pull replications trough specific channels.

We want to do the same on Phonegap, but the REST API documentation does not mention how to set specific channels to replicate.

Can you give us some instructions to replicate specific channels in Phonegap?


I think that under the hood, CBL uses a channels parameter in the url to specify a particular channel to pull from.

I don’t know if the _replicate endpoint on the Listener API has a params field in the JSON that would make it possible to specify this (I know there’s one for headers but not sure about the query string).
@jens Is there a field in the JSON to do this from the Listener API?



Hello @jamiltz and @jens

I found a Google Groups (Pull filter / Unknown filter) reference to filtered replication in phonegap , but it seems like an old or missed reference in actual documentation. Can you confirm we can still use such method in Couchbase Lite and Sync Server 1.1.0?


In the REST API, use a filter parameter with value sync_gateway/bychannel, and a channels parameter whose value is the channel names separated by commas.

(The channels property in the native API is actually just a shortcut that does exactly this under the hood.)


Hi is this still the way to go with couchbase lite 2.0?
Following the tutorial on
it says to replicate the following way:
this.database.sync(“”, true);
I use sync gateway 1.5 and couchbase lite 2.0 via the Couchbase-Lite-PhoneGap-Plugin
My docs all have a “channels” property with a list of channels.

How do i only sync specific channels?

also see


I have responded to your other post on this topic