How do I set document expiry time when using sync gateway?

Tombstoning is the canonical way to delete a document with Couchbase. It is a special type of revision that simply has a _deleted flag present (and most likely nothing else). The reason for this is because normally there is no way to distinguish between a document being deleted and a document sitting there with nothing happening to it. If it were to simply vanish from the database, it would not be picked up in the changes feed because the changes feed is forward looking only. Any new information on the document needs to be in a revision or it will potentially be missed by a client. This includes deletions.

That being said, you may be able to write a backend service that sits next to sync gateway that can perform this kind of expiration via the proper deletion mechanism (The most robust, if not performant way to do it would be a garbage collection of sorts which periodically scans the documents for their expiration dates and creates a delete revision for them if they are past due)