Prevent document from getting synced to Couchbase Lite

We want to store documents of a particular type in Couchbase Server only and those documents should not get synced down to Couchbase Lite. These documents are written directly to Couchbase Server.

Currently Sync Gateway sync function rejects these documents with message: [INF] Import: Error importing doc “xxxxxxxxxx”: 403 Invalid document type.

Is this the right approach? Do we need to do something differently on these documents in sync function?

Please share your sync configuration. If you don’t want to import documents for sync, you specify that in the import filter.

Thanks, Priya. I think import filter is what we need. Does import filter trigger before sync function is triggered?

Yes, it does. The Sync Gateway processes the imported documents through the sync function. The import filter determines what gets processed