Manage Scopes and Collections
- Capella Operational
Scopes and collections, which allow documents to be categorized and organized within a bucket, can be created and deleted within the Capella UI.
Scopes and collections categorize and organize documents within a bucket. A collection is a data container within a bucket. A scope is a mechanism that groups multiple collections. Each cluster can hold up to 1000 scopes and up to 1000 collections. For a complete overview, see Scopes and Collections.
Accessing Scopes in the Couchbase Capella UI
-
Open the Buckets page for your cluster:
-
With the Operational tab open, select your cluster.
-
Click the Data Tools tab.
-
In the navigation menu, click Buckets.
-
-
Click the bucket with the scopes you want to view.
Scopes View
A bucket’s Scopes view lists all the scopes within that bucket in a tabular format, including the number of collections within each scope.
Actions are available to create and delete scopes, and add collections to an open scope. The Bucket list allows you to switch between buckets in the current cluster and view their respective scopes.
Create a Scope
To create a scope, you need the Project Owner
or Project Manager
role for the project with the cluster where you’re creating the scope.
-
Open the Buckets page for your cluster:
-
With the Operational tab open, select your cluster.
-
Click the Data Tools tab.
-
In the navigation menu, click Buckets.
-
-
Click the bucket where you want to create a scope.
-
With the Scopes view open, click Create Scope.
-
Enter a name for the scope.
In the Name field, enter a scope name. A scope name can only contain the
A-Z
,a-z
, and0-9
characters as well as the-
,_
, and%
symbols. It can’t start with either the_
or%
symbols. It can’t be longer than 251 characters in length and is case-sensitive. -
Click Create Scope.
Delete a Scope
To delete a scope, you need the Project Owner
or Project Manager
role for the project with the cluster where you’re deleting a scope.
Deleting a scope deletes all of the collections and documents in that scope from the cluster. You can only restore them from a previous backup. |
-
Open the Buckets page for your cluster:
-
With the Operational tab open, select your cluster.
-
Click the Data Tools tab.
-
In the navigation menu, click Buckets.
-
-
Click the bucket where you want to delete a scope.
-
With the Scopes view open, at the end of the row of the scope you’re deleting, click the Trash icon.
-
Confirm the delete request:
-
Type
delete
into the confirmation field. -
Click Delete Scope.
-
Accessing Collections in the Couchbase Capella UI
To view and manage collections in a bucket, open a scope’s Collections view:
-
Open the Buckets page for your cluster:
-
With the Operational tab open, select your cluster.
-
Click the Data Tools tab.
-
In the navigation menu, click Buckets.
-
-
Click the bucket with the collections you want to view.
-
Click the scope with the collection you want to view.
This shows the Collections view for the chosen scope.
Create a Collection
To create a collection, you need the Project Owner
or Project Manager
role for the project with the cluster where you’re creating the collection.
-
Open the Buckets page for your cluster:
-
With the Operational tab open, select your cluster.
-
Click the Data Tools tab.
-
In the navigation menu, click Buckets.
-
-
Click the bucket where you want to create a collection.
-
With the Scopes view open, click the scope where you want to create a collection.
-
With the Collections view open, click Create Collection.
-
Enter a name for the collection.
In the Name field, enter a name for the new collection. A collection name can contain the
A-Z
,a-z
, and0-9
characters as well as the-
,_
, and%
symbols. It can’t start with either the_
or%
symbols. It can’t be longer than 251 characters in length and is case-sensitive. -
Enter a time to live (TTL) value.
In the TTL field, enter an expiration time in seconds for the new collection. By default, the TTL for collections is
0
, meaning it uses its bucket’s TTL value. To prevent the bucket’s TTL from setting a default expiration for your collection’s documents, set the TTL value to-1
.For more information about expirations and collections, see Expiration.
-
Click Create Collection.
Delete a Collection
To delete a collection, you need the Project Owner
or Project Manager
role for the project with the cluster where you’re deleting the collection.
Deleting a collection deletes all of the documents within it from the cluster. You can restore these documents from a previous backup. |
-
Open the Buckets page for your cluster:
-
With the Operational tab open, select your cluster.
-
Click the Data Tools tab.
-
In the navigation menu, click Buckets.
-
-
With the Scopes view open, click the scope where you want to create a collection.
-
With the Collections view open, at the end of the row of the collection you’re deleting, click the Trash icon.
-
Confirm the deletion:
-
Type
delete
into the confirmation field. -
Click Delete Collection.
-