How to sync particular document from Couchbase server for mobile


#1

I have created an application in swift. and I am using couchbase Lite in the application. I succeed to sync all document from couchbase server. but I want to sync only particular document from server. for that I googled a lot but got information about what is ‘Channels’. but I didn’t found any code how to create channels for particular document syncing.
Please let me know that how can I create and use channels for particular document syncing from couchbase server?


#2

@pnikumbh

Channels are a Sync Gateway concept for sharding documents within a database. You can define which users can access a channel, either statically by setting the channels on the user object in the ADMIN REST API, or dynamically by giving access to the channels in the Sync Gateway sync function.

There is an overview of Sync Gateway including channels here

Here is documentation on data routing with channels

Here is documentation on the Sync Function API