Purging A Channel

I’m using SGW 2.8. Is there an easier way to purge a channel? With the SGW REST API, I’m fetching all docs in a channel with /{db}/_changes then sending it to /{db}/_purge

To purge a channel do I need to do anything else other than delete all documents in the channel?

Deleting all documents belonging to the channel is all you need to do - no other channel-specific information is stored anywhere.

Your /{db}/_changes and /{db}/_purge requests would result in clients not seeing the deleted documents - which may or may not be desirable for you.

An alternative could be to use N1QL to delete documents matching your criteria/channel routing logic to do it in bulk.

1 Like