A newer version of this documentation is available.

View Latest

collections-details

  • reference
March 16, 2025
+ 12
Provides low-level details on collections.

Syntax

cbstats host:11210 [common options] collections-details [vbucket-reference]

Description

This command is used to provide low-level details on collections, for a specified bucket. This includes details identifying the existing collections; and vBucket-specific details, which include sequence numbers and item counts.

Options

The optional vbucket-reference parameter is an integer, in the range of 0 to 1023 inclusive, specifying a particular vBucket. If a vBucket is specified, the only details returned are the vBucket-specific details for that vBucket. If no vBucket is specified, vBucket-specific details for all vBuckets are returned, as well as details identifying the existing collections for the bucket.

For information on returning a vbucket-reference that corresponds to a particular document id, see the section Examples: Find vBucket IDs, on the reference page for the cbstats command key. For common cbstats options, see cbstats.

Examples

The following command retrieves collections-details on all vBuckets for travel-sample:

/opt/couchbase/bin/cbstats localhost:11210 \
-u Administrator -p password \
-b travel-sample collections-details

The initial section of the output is as follows:

0x0:0x0:name:                      _default
0x0:0x17:maxTTL:                   3000000
0x0:0x17:name:                     MyCollection
0x8:0x8:name:                      bookings
0x8:0x9:name:                      users
0x9:0xa:name:                      bookings
0x9:0xb:name:                      users
0xa:0xc:name:                      bookings
0xa:0xd:name:                      users
0xb:0xe:name:                      users
0xb:0xf:name:                      bookings
0xc:0x10:name:                     bookings
0xc:0x11:name:                     users
0xd:0x12:name:                     route
0xd:0x13:name:                     airline
0xd:0x14:name:                     airport
0xd:0x15:name:                     hotel
0xd:0x16:name:                     landmark
manifest_uid:                      2
vb_0:0x0:disk_size:                21674
vb_0:0x0:high_seqno:               97
vb_0:0x0:items:                    38
vb_0:0x0:name:                     _default
vb_0:0x0:ops_delete:               0
vb_0:0x0:ops_get:                  0
vb_0:0x0:ops_store:                0
vb_0:0x0:persisted_high_seqno:     97
vb_0:0x0:scope:                    0x0
vb_0:0x0:start_seqno:              0
vb_0:0x8:disk_size:                85
vb_0:0x8:high_seqno:               8
vb_0:0x8:items:                    0
vb_0:0x8:name:                     bookings
vb_0:0x8:ops_delete:               0
vb_0:0x8:ops_get:                  0
vb_0:0x8:ops_store:                0
vb_0:0x8:persisted_high_seqno:     8
vb_0:0x8:scope:                    0x8
vb_0:0x8:start_seqno:              8
vb_0:0x9:disk_size:                83
vb_0:0x9:high_seqno:               7
vb_0:0x9:items:                    0
vb_0:0x9:name:                     users
vb_0:0x9:ops_delete:               0
vb_0:0x9:ops_get:                  0
vb_0:0x9:ops_store:                0
vb_0:0x9:persisted_high_seqno:     7
vb_0:0x9:scope:                    0x8
vb_0:0x9:start_seqno:              7
vb_0:0x10:disk_size:               85
vb_0:0x10:high_seqno:              16
vb_0:0x10:items:                   0
vb_0:0x10:name:                    bookings
vb_0:0x10:ops_delete:              0

      .
      .
      .

Each line of the output presents a data key. Each key is of the format scopeID : collectionID : datumLabel. Each scopeID or collectionID is a hexadecimal number, prefixed by 0x. Each datumLabel is a string. Each data key is concluded with a colon, and the associated value is presented to the right of the colon.

The initial lines provide information that identifies existing collections in the vBucket. Each is identified with hexadecimal numbers: for example, the _default collection is identified as 0x0 (residing within scope 0x0); and MyCollection as 0x17 (residing within scope 0x0).

(Note that the _default collection is indeed provided by default, within the _default scope, for every Couchbase or Ephemeral bucket. The collection MyCollection is one that has been custom-created by the administrator, and does not appear in the sample bucket travel-sample by default.)

The manifest_uid value (here, 4) is associated with the current state of collections on the node; and will be incremented whenever a collections-related change is made.

The disk_size value represents the total size of the collection items on disk.

The ops_get value indicates the total number of get operations for this collection, in the vBucket. The ops_store value indicates the total number of store operations for this collection, in the vBucket. The ops_delete value indicates the total number of delete operations for this collection, in the vBucket. Note that these ops_ values are all reset to zero, if the Data Service restarts.

A maxTTL value is provided only when a collection is defined with a maximum time to live (maxTTL).

Subsequent information in the output relates to each vBucket corresponding to travel-sample, on the current node. The vBuckets are numbered, from 0 to 1023. For each vBucket, information is provided on sequence numbers and total items.

The following command specifies a vbucket-reference, thereby returning information on the specified vBucket only:

/opt/couchbase/bin/cbstats localhost:11210 \
-u Administrator -p password \
-b travel-sample collections-details 8

Details for vBucket 8 are duly returned:

vb_8:0x0:disk_size:             14140
vb_8:0x0:high_seqno:            73
vb_8:0x0:items:                 26
vb_8:0x0:name:                  _default
vb_8:0x0:ops_delete:            0
vb_8:0x0:ops_get:               0
vb_8:0x0:ops_store:             0
vb_8:0x0:persisted_high_seqno:  73
vb_8:0x0:scope:                 0x0
vb_8:0x0:start_seqno:           0
vb_8:0x8:disk_size:             85
vb_8:0x8:high_seqno:            8
vb_8:0x8:items:                 0
vb_8:0x8:name:                  bookings
vb_8:0x8:ops_delete:            0
vb_8:0x8:ops_get:               0
            .
            .
            .

See Also

For an overview of scopes and collections, see Scopes and Collections.

For a step-by-step explanation of creating scopes and collections with the CLI, see Manage Scopes and Collections with the CLI. For a comparable explanation with the REST API, see Manage Scopes and Collections with the REST API.

To use cbstats to provide higher-level information on collections, see the reference page for the collections command.