January 18, 2016, 9:51am
we need to cleanup our database periodically as it grows and devices are becoming very slow. In order to achieve that we:
Delete old documents on the server through Sync Gateway REST API
Synchronise deleted revisions to the devices through pull replication
Run compact on the local database
Apparently running compact on the local database does not purge deleted documents.
Is there a way to purge all deleted documents after pull replication through the Couchbase Lite API? We do not have the REST API setup on the devices.
The only way I can think about is to create a view and purge documents one by one.
January 18, 2016, 5:07pm
Deletion is not the same as purging.
To purge documents on the client, use the
January 18, 2016, 5:12pm
Is that the only way to purge documents by purging one by one? Like I explained above by having a view to get all deleted documents and then go through the list.
I was looking for some kind of automated way to purge all deleted documents at once.
January 18, 2016, 5:28pm
There’s no built-in mechanism to purge deleted documents. But it just takes a couple of lines to do it yourself. If you don’t want to create a view, you can just run an all-docs query, with the mode that includes deleted documents.