Pull selected data to couchbase.lite

Hi,

Currently am working on a project where List of appointments and attachments should be pulled from the couchbase server via sync_gateway. As am new to this couchbase i was wondering how can i make filtered pull from the sync_gateway.

Currently the structure of database is designed as

Appointments_DB - 101-docId,102-docId,103-docId … etc
Attachments_DB - 101-docId,102-docId,103-docId … etc

So what i wanted was if User with ID 101 logins with the app then the Documents with ID 101 should be pulled from the Server and rest should be ignored the same goes for the attachments puller also.

How can i do this and where should i start with it.

Development environment - Xamarin.Android / Couchbase.Lite
Thanks in advance.

@dineshbala1

You can shard your document space by tagging documents with channels and then giving users access to different channels. This is achieved through the Sync Gateway sync function.

There are docs covering Data routing with channels and Sync Function API