Couchbase lite Pull Replication with DocIds is returning all documents

I need to pull documents from sync gateway with specific document ids. When I start pull replication, I can see all the documents in the server is getting downloaded to the local database instead of the specified documents. Is there any way to pull specific documents using doc Ids?

Below is the code:
var repl = this.Database.CreatePullReplication(syncGateway);
repl.Continuous = false;
repl.DocIds = new List() { “PQ0003”, “PQ0004” };
repl.Start();

Thank you in advance.

I’m not sure Sync Gateway supports this replication mode. (@adamf?)

But I can see sample code in below link
https://developer.couchbase.com/documentation/mobile/1.4/guides/couchbase-lite/native-api/replication/index.html#filtering-by-document-ids

Sync Gateway does support using a doc id filter for one-shot replications. Getting a look at the Sync Gateway logs might shed some light on why all documents are being replicated.

Actually I don’t have access to sync gateway log. I’ll try to check sync gateway log with server team. But when I check fiddler I can see below URL to the sync gateway for above code. That mean, couchbase lite will download all the documents?

http://sync_gateway_server:PORT/db/_changes?feed=normal&heartbeat=300000&style=all_docs&since=0&active_only=true

Is that a GET or a POST? If the latter, can you show the request body too?
Also, what platform is this?

It is a GET method.This is a C# application for windows 10 platform.

This feature was not supported by Sync Gateway when this part of C# was written and so it will ignore the DocIDs setting unless the server is a CouchDB instance. You should see an entry in your logs that says “DocIds parameter only supported on CouchDB.” I was unaware that this change made it into Sync Gateway and so this will need to be added as a feature.

I filed this ticket to track. It won’t be a large change to support it so it might get into 1.4.1 (need to talk with the team though).

Thank you for the support. I able to pull specified documents using below code.

			var repl = this.Database.CreatePullReplication(syncGateway);

            repl.Continuous = false;
            repl.Filter = "_doc_ids";          
            repl.FilterParams= new Dictionary<String, Object>() { { "doc_ids", docIdList }};
           
            repl.ReplicationOptions.MaxOpenHttpConnections = 40;
            repl.ReplicationOptions.Heartbeat = new TimeSpan(0, 0, 25);
            repl.ReplicationOptions.MaxRevsToGetInBulk = 50;
            repl.Changed += OnServerPullReplicationChanged;

            repl.Start();