Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CouchDB replicate without deleting documents

Tags:

couchdb

Hi: I want to use a mobile CouchDB and a remote CouchDB. To transfer from mobile to remote DB I want to replicate the data. But for storage reasons I want to regularly delete old data from the mobile CouchDB and keep it on the remote CouchDB. As what I have seen local deletion will also be replicated. Is there any knowledge about how to handle this?

like image 516
Sney Avatar asked Jan 21 '23 07:01

Sney


1 Answers

You should be able to use filtered replication, http://wiki.apache.org/couchdb/Replication#Filtered_Replication, with a filter function of:

function(doc) {
    return !doc._deleted;
}
like image 92
Matt Goodall Avatar answered Feb 01 '23 00:02

Matt Goodall