I am designing a system that will use CouchDB and TouchDB\CloudantSync to cache the database on the users' smartphone using replication. Now Let's say I have 1000s of documents, each has a 100Kb attachment, and I want to free some space on the smartphone by removing a document.
I want that after I remove some document, I could replicate it again from the server. This is different from deletion, which will give the document a new revision and avoid replicating it from the server again (because the deleted document on the smartphone is a child of the undeleted one).
I could obviously make redundant updates on the server documents, but that's inefficient...
Is there a way to "unsync" the document?
resynced: true
to the document's json. Don't forget to update the replication filter and the unsycned_documents list.resynced: true
).I'm talking about the case where a one-way (Server -> User) replication is required. i.e., the users only have read-permissions. If you give the users write permission, you should find a way to differ between an intentional deletion of a document and "unsyncing".