Deleting data in syncgateway

  1. I added some data using syncgateway Admin API, then this data was synchronised on my iPhone, everything fine.

  2. Then I deleted data using syncgateway API using this methods:
    GET http://localhost:4985/dbname/_all_docs - to get doc ids
    POST http://localhost:4985/sbis_mobile2/_purge - with json body with doc ids.

  3. Then I go in web interface and see what there are no any documents:

  4. Fine. Now I go on my iPhone and delete application in order to clear my local database.
    Now I start my application (it is installed again) and see some data. That’s not all data I have added in step 1. It’s looks like strange pieces. Only after restart syncgateway this data pieces has been deleted.

Why SG stored some data although it was fully deleted? Why SG do not show me that data in web interface? I don’t want my device receive some strange piece of data which I cannot see in some other place. Please help. Thanks in advance.

PS. Please suggest viewer instrument for couchbase data on server. Now I use SG web interface and it looks bad and inconvenient.

@ma.kazakov,

What version of SG and CBL are you using?

Do you have access to the SG logs?

What are the SG logs set to? “log”:["???","???"]

Purge does not delete documents. It sounds like you’re seeing data getting partially synced back from the iOS app before removing it.

See the details of purging under the Admin REST API docs here.

Also these links may be helpful: https://developer.couchbase.com/documentation/mobile/current/guides/couchbase-lite/native-api/document/index.html#purging-documents and this issue https://github.com/couchbase/sync_gateway/issues/1453