flushBucket

suspend fun flushBucket(bucketName: String, common: CommonOptions = CommonOptions.Default)

Removes all documents from a bucket.

Flush must be enabled on the bucket in order to perform this operation. Enabling flush is not recommended in a production cluster, as it increases the chance of accidental data loss.

Keep in mind that flush is not an atomic operation. The server will need some time to clean the partitions out completely. If an integration test scenario requires isolation, creating individual buckets might provide better results.

Throws

com.couchbase.client.core.error.BucketNotFoundException

if the specified bucket does not exist.

com.couchbase.client.core.error.BucketNotFlushableException

if flush is not enabled on the bucket.