Is there a way to compact views in couchdb lite for Android

The data for my application continues to increase and I'm aware of the need to occasionally compact but I don't know how to do that via the couchbase lite. I noticed that there is a compact method on CouchDbConnector but that doesn't seem to have a positive effect.

1 Answer

« Back to question.

Which version of Couchbase Lite Android are you using?

From the sound of it, you are currently using Ektorp. In the beta2 version, there is a Native Java API available and it's no longer necessary to use Ektorp. If possible, please switch over to that.

In the native API there is a method database.compact() that should do what you need.

Otherwise, let me know what version you are using and I can try to look into it.

I'm using the beta that uses ektorp. Unfortunately I took advantage of defining views in annotations and repositories and a few other ektorp specfic stuff so I'm going to miss that if I have to upgrade to beta2 :(. I did try the ektorp compaction methods but those gave errors

Beta2 does still work with ektorp, see https://github.com/couchbase/couchbase-lite-android/issues/185

If you could upgrade to beta2, it would make it easier to give you support.

Also I know that in beta2 the compact REST api call underwent functional testing, so I'm confidant that it works. In beta1 I'm not so sure.