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();
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?
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.