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.