A newer version of this documentation is available.

View Latest

Flush a Bucket

      Flushing deletes every object that a bucket contains.

      Enable Flushing

      To edit an existing bucket-configuration, access Couchbase Web Console, and left-click on the Buckets tab, in the vertical navigation-bar at the left-hand side.


      The Buckets screen now appears, showing the buckets that have already been defined for your system:


      To edit the settings for a particular bucket, left-click on the bucket’s row in the UI; then, when the Edit button appears, left-click on it:

      This displays the Edit Bucket Settings dialog, which permits changes to be made to a subset of existing settings. All the settings contained here are described in detail for the Add Data Bucket dialog, in the section Create a Bucket

      Left-click on the Show advanced bucket settings tab. This causes the Add Data Bucket dialog to expand vertically; and thereby display additional information. Navigate to the bottom of the expanded dialog, and locate the Flush panel. This provides a checkbox, the checking of which enables flushing for the current bucket:


      Note that flushing can also be enabled during bucket-creation. See Create a Bucket for details.

      Once enabled, flushing can be performed by means of Couchbase Web Console: with the Buckets screen displayed, left-click on the row of a bucket for which flushing has been enabled. The displayed options now include the Flush button.


      When the Flush button is left-clicked on, flushing of the bucket occurs. This causes all items in the bucket to be deleted by the system at the earliest opportunity. Note that for this reason, you are recommended not to run with the Flush setting enabled in production; due to the danger of all a bucket’s data being inadvertently lost.

      Note also that flushing cannot be performed while the bucket is the source for an outgoing XDCR replication. For an introduction to XDCR, see Cross Data Center Replication (XDCR).

      Providing Authorization

      To flush a bucket, an administrator must have one of the the following roles:

      • Full administrator

      • Cluster administrator

      • Bucket administrator

      See Authorization, for information on users and roles.

      Using the CLI and REST API

      You can also enable flushing by means of the CLI command bucket-flush, and the REST API method rest-bucket-flush.