Compacting buckets

Compacting buckets

Buckets are compacted using the couchbase-cli bucket-compact command.

Description

The bucket-compact command has the same options available as the other bucket-* commands. This section describes a small subset of options.

Syntax

Request syntax:

couchbase-cli bucket-compact -c [localhost]:8091 -u [admin] -p [password] 
    --bucket=[bucket-name]
    [additional options]
      

Example

To compact a bucket for both data and view:


couchbase-cli bucket-compact -c 192.168.0.1:8091 -u Administrator -p password 
        --bucket=test_bucket

To compact a bucket for data only:


couchbase-cli bucket-compact -c 192.168.0.1:8091 -u Administrator -p password 
        --bucket=test_bucket \
        --data-only

To compact a bucket for view only:


couchbase-cli bucket-compact -c 192.168.0.1:8091 -u Administrator -p password 
        --bucket=test_bucket \
        --view-only