Setting _deleted = true doesn't affect Sync Gateway

When I set _deleted = true in a document, the doc is still synchronised by sync gateway. How do I tell the gateway to ignore _deleted=true docs?

You need to replicate deletes to clients in order for them to know what to remove. These are generally referred to as tombstones.

If you don’t care about what clients have, or don’t have, you could purge the document, but be aware that clients may push it up to Sync Gateway again, as it will think it’s a new document. You have to purge the document from all devices.

https://docs.couchbase.com/sync-gateway/2.1/managing-tombstones.html#purging-tombstones
https://docs.couchbase.com/sync-gateway/2.1/admin-rest-api.html#/document/post__db___purge

1 Like