I believe I answered this part of the question earlier about how to set a field, replicate and then delete .
Basically, once the document change is replicated and pushed to a different channel as discussed above , you can purge it locally if you’d like. You don’t have to do that though - in the next replication cycle, since document is removed from the channel that the client has subscribed to , you will see it come down with a special _removed
flag that you can use as an indication that this document is not to be used by your client.
As for this part of your question
even if there is no connection?
Well- if you are offline, you cannot replicate the change . So you can’t purge the document locally since the the changed document isn’t up on the server.
I would think that you should implement app-layer logic to handle the case- basically disallow usage of the document locally if the flag is set.