Can sync gateway channels be used in Couchbase server

The sync metadata is added by and used by the Sync Gateway for syncing documents over to the clients. It’s not used by CB server. With SG 1.5/CB5.0, the sync metadata is no longer stored in the document and that’s why you don’t see it in the document via the admin console… It is stored in XAttrs. There is currently no way to N1QL query for or view the XAttr information via CB.

Well. I am not so sure if it’s a good idea design-wise to update your application’s data model to retrofit it with data to deal with the way couchbase handles data routing.

If all you are doing is querying for the data , any reason why your web app can’t use the REST API exposed by Sync Gateway to query for this information?

Alternatively, assuming that the sync function routes documents to different channels based on some criteria, why don’t you use the same criteria for querying the documents from server? (Example : If you are using “name” property for assigning channels, why don’t you issue a N1QL query for documents with “name” equal to specific value)