How to delete the document in Couchbase Server and Couchbase lite


#1

Folks,
In my server use:

  • Windows 2012 R2 64-bit
  • Couchbase Server 3.0.1 64-bit
  • Couchbase Sync Gateway 1.2.0
  • Couchbase .Net Client 1.3.10.0
    I developed an app that fetches data in SQL Server and saved in Couchbase server.
    To use the sync gateway, use “shadow”.

In Mobile Android application (Xamarin C #) use:

  • Couchbase Lite 1.2.0.3

My question is:
HOW TO DELETE A DOCUMENT IN COUCHBASE.LITE AND Couchbase SERVER?
I need the document there is no longer anywhere!


#2

Use the _purge operation in the Sync Gateway REST API.

But if you do that, Sync Gateway forgets about the document completely, so it no longer knows to push it to clients. If you want the deletion to be propagated to clients, you should delete the document instead (a normal REST DELETE). The document will still be present but as a “tombstone” that has no content, but just marks the deletion.