If you remove or delete a document via SDK or directly couchbase server, the oldDoc will be null. You don’t have to do anything specific in terms of putting deleted documents into channel - the SGW will take care of it for you. The document is already in a channel and would now be updated with the _deleted flag as true.
This test would be the check to see if document is removed.
function isRemoved() {
return( isDelete() && oldDoc == null);
}
So this is all you would have to do in your…
I’ve been doing some more research and it doesn’t seem that my current sync function is incorrect. I’m using the same method as suggested by @priya.rajagopal