Reputation: 4563
Couchbase server has a method to remove all the stored data in a bucket called doFlush. It is invoked through the following command:
POST /pools/default/buckets/[bucket-name]/controller/doFlush
When I try to invoke this function using the Sync Gateway API, it returns the following error:
{'error': 'not_found', 'reason': 'unknown URL'}
Sync Gateway does have a way to delete a bucket, but that operation only removes the bucket from the configuration file. It does not actually delete the records associated with it. Is there a way to flush Sync Gateway, or as a fallback delete the stored data?
Upvotes: 1
Views: 445
Reputation: 41
On the outset, understand that Database in Sync Gateway and Bucket in Couchbase Server are different.
Sync Gateway cannot flush a bucket because it is a separate entity than the Couchbase Server where bucket exists and it does not have privileges to flush or even delete a bucket. Database in Sync Gateway just means an object created which refers to the bucket in Couchbase Server.
doFlush does not work with Sync Gateway because it belongs to Couchbase Server API and not Sync Gateway API.
With Sync Gateway versions 1.*, since sync related metadata was stored along with the data in the main bucket or in the Shadow bucket, flushing both would have removed the sync related data. Now since sync related metadata is stored in XAttrs, flushing the bucket does not remove the XAttrs resulting in subsequent changes.
Upvotes: 1