I created some documents via the Sync Gateway API.
I PUSHED them into the DB via Sync Gateway (worked)
Then I PURGEd all documents in the LOCAL DB (on Android)
After I started PULL I expected the docs to be resend to the local DB again. It worked once, after that PULL had no effect.
Purging a document is different from deleting it; it’s more like forgetting it. The purge method removes all trace of a document (and all its revisions and their attachments) from the local database. It has no effect on replication or on remote databases, though.
Purging is mostly a way to save disk space by forgetting about replicated documents that you don’t need anymore. It has some slightly weird interactions with replication, though. For example, if you purge a document, and then later the document is updated on the remote server, the next replication will pull the document into your database again.
Indicating that a document would only be synced “back” to the client if it changes.
Thank you martinesman. I was going crazy about this behaviour.
Another question:
Is there a possibility to resync ALL documents, even the purged docs without editing each document in the remote DB?.
I need to be able of removing all documents locally, and to restore them inside the local DB automagically from the remote DB.
you could just delete the entire database Manager.SharedInstance.GetDatabase(“db”).Delete and
then pull all documents again. That would re-sync all documents from the remote endpoint.
The sync gateway logs the following. It is interesting, that 404 is reported every tim I am starting the pull-sync.
As reported here 404 on _local document is reported when sync is done for the first time,
Hi @skipidar,
What happens if you pull the documents again after the 404 error (in the sync function with the channels)? If you continue to get a 404 I will get support to investigate if this (user rights and channels) is a bug.
Is it a usable solution to delete the database and restore all documents?