Details
-
New Feature
-
Resolution: Unresolved
-
Major
-
None
-
None
Description
As a Sync Gateway consumer I would like to skip some of the fields syncing in and out from a device.
The end consumer would not like to receive some of the control fields the application uses.
for example the real document is:
{ "doc_type_id": 3, "doc_type_name": "some name", *"is_active": true,* "is_attached": true, }
The mobile device would get only a subset of the document when configured.
for example is_active is not necessary.
Workaround :
Use eventing service that will generate a new "mobile" version of the document to sync with mobile clients. This option is reasonable when it is a pull only replication and changes are pulled down by Couchbase lite clients. Although two separate buckets need to be maintained as eventing service does not work on R-W bucket with Sync Gateway.
Things get complicated if the documents are modified and pushed up by Couchbase Lite. In that case, a reference the base document needs to be maintained within the modified document so the eventing service can appropriately patch back the changes to the base document
Forums:
https://forums.couchbase.com/t/allow-access-to-certain-fields-of-document/27857