BUCKET.LIST
Returns the names of all buckets in the current namespace.
Syntax
Section titled “Syntax”BUCKET.LISTThis command takes no parameters.
Return Value
Section titled “Return Value”Returns an array of bulk strings, one per bucket. Each element is the bucket name. If the namespace contains no buckets, an empty array is returned.
Buckets that have been marked for removal with BUCKET.REMOVE but not yet purged with BUCKET.PURGE are still included
in the result. Only after a successful BUCKET.PURGE does the bucket disappear from the list.
Errors
Section titled “Errors”| Error Code | Description |
|---|---|
NOSUCHNAMESPACE | The namespace does not exist. |
NAMESPACEBEINGREMOVED | The namespace is being removed. |
Examples
Section titled “Examples”List buckets on a fresh namespace (no buckets exist):
> BUCKET.LIST(empty array)List a single bucket:
> BUCKET.CREATE usersOK
> BUCKET.LIST1) "users"List multiple buckets:
> BUCKET.CREATE alpha-bucketOK
> BUCKET.CREATE beta-bucketOK
> BUCKET.CREATE gamma-bucketOK
> BUCKET.LIST1) "alpha-bucket"2) "beta-bucket"3) "gamma-bucket"Bucket disappears only after purge, not after remove:
> BUCKET.CREATE usersOK
> BUCKET.REMOVE usersOK
> BUCKET.PURGE usersOK
> BUCKET.LIST(empty array)