Doc Still in Local.db after deleting user access to doc, CouchBase.lite Couchbase sync

Good evening,

in my app a Doc Contains:
Members Property : list of users who have access to that doc

in the sync gateway config File, i gave the access to the list of Members users to that doc, and the synchronisation between Couchbase.lite and couchbase using the sync_gateway is working properly for the users who have access to that doc.

the problem is that when i delete the userid from the members Property ( means that he have no access to that doc anymore ) , its not synchronized again but the doc still in the local Mobile db.

how to delete that doc from local db ?

Thank you for your time.

How are you enforcing user access to the doc ? You should be using channels .One option - If each user has its own channel, you can remove access to doc but removing doc from user’s channel . That will send a removal change to the client. Couchbase Lite creates a tombstone revision corresponding to the doc when it receives this. This doc will no longer appear in any future queries or replications. So it is removed for all practical purposes from the database.
In an upcoming release of Couchbase Lite, we will be introducing features that will facilitate the purging of the removed docs