How to set channels to a Document in Couchbase Lite

Hi Folks,

Is there any way to set the channels for a document directly in the Application using Couchbase Lite (1.4)?

Thanks

Not directly. Couchbase Lite knows basically nothing about channels; they’re a server-side thing. And in general, letting the client assign channels would be a security problem since the client can’t be 100% trusted.

What you can do is define a schema for your system where the channel ID is stored in a property in the document, and the SG sync function assigns a channel based on this property. In fact, that’s the default behavior of the sync function if you don’t provide your own.

1 Like

All right! Thanks @jens