Reputation: 3327
I've got one db per user, from which I use a filtered replicate to send documents marked public into a single common database. I have this working. now when a user changes their document from public to private, the replications does not clear the document from the common database.
Aside from reading all of the private documents from the userDb and then removing them from the common db (if they exist), is there anyway to accomplish this via fundamental replication features?
Upvotes: 0
Views: 223
Reputation: 1453
Short answer: No.
Long answer: The replicator will not delete documents on the remote unless the document was deleted in the local database. Filter functions just determine what is allowed to be replicated. So your use case can be done but in a way I would think is slightly abusive of the CouchDB model if the user changes the document to private, you could:
As long as your filter function allows deletes to be replicated to the remote, the document will be deleted, however the usual caveats around how CouchDB deletes documents apply.
Upvotes: 0