BUCKET.LIST
Returns the names of all buckets in a namespace. Without NAMESPACE, it lists the session’s current namespace.
Syntax
Section titled “Syntax”BUCKET.LIST [NAMESPACE <path>]Arguments
Section titled “Arguments”| Argument | Type | Required | Description |
|---|---|---|---|
NAMESPACE | string | No | Run this command in the given namespace instead of the session’s current one. The namespace must exist. The session’s current namespace does not change. |
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”Argument errors:
| Error Code | Error message | Cause |
|---|---|---|
ERR | Unknown '<keyword>' argument | - |
ERR | NAMESPACE argument must be followed by a namespace | - |
Namespace errors:
| Error Code | Error message | Cause |
|---|---|---|
NOSUCHNAMESPACE | No such namespace: '<path>' | - |
NAMESPACEBEINGREMOVED | Namespace '<path>' 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)