0

I'm thinking about using Couchbase Lite's powerful sync capabilities to upload activity logs from clients to a CouchDB server. The client would just create log entries as documents in some DB that would replicate to the online DB.

My concern is that, in order to save precious disk space on the client side, I would like to purge old logs periodically (like, those older than x days for example). But doing so would also delete the corresponding documents in the online DB as part of the replication process...

So my question is, would there be a workaround in order to keep only the last logs on the client without purging the online DB?

Thanks

ThomasWeiss
  • 1,292
  • 16
  • 30

1 Answers1

0

I think I managed to achieve that by adding a filter to my (client) DB that filters out deleted revisions. In .NET, it looks like:

myDatabase.SetFilter("prevent-deletion", (rev, filterParams) => !rev.IsDeletion);
ThomasWeiss
  • 1,292
  • 16
  • 30