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 Buckets, Scopes, and Collections.
Accessing Scopes and Collections in the Couchbase Capella UI
-
Go to the Operational tab and click your cluster name.
-
Go to Data Tools.
-
In the side pane, expand Data to open the Data Insights area.
-
In the Data Insights area, explore the tree structure to view your buckets, scopes and collections.
Create a Scope
To create a scope, you need the Project Owner or Cluster Manager role for the project with the cluster where you’re creating the scope.
-
Go to the Operational tab and click your cluster name.
-
Go to Data Tools.
-
In the side pane, expand Data to open the Data Insights area.
-
In the Data Insights area, find the bucket where you want to create a scope.
-
Next to the bucket name where you want to create a scope, go to .
-
In the Scope Name field, enter a scope name.
A scope name can only contain the
A-Z,a-z, and0-9characters as well as the-,_, and%symbols. It cannot start with either the_or%symbols. It cannot 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 Cluster 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. |
-
Go to the Operational tab and click your cluster name.
-
Go to Data Tools.
-
In the side pane, expand Data to open the Data Insights area.
-
In the Data Insights area, find the bucket where you want to delete a scope.
-
Next to the scope name you want to delete, go to .
-
Confirm that you want to delete the scope.
-
Click Delete
Create a Collection
To create a collection, you need the Project Owner or Cluster Manager role for the project with the cluster where you’re creating the collection.
-
Go to the Operational tab and click your cluster name.
-
Go to Data Tools.
-
In the side pane, expand Data to open the Data Insights area.
-
In the Data Insights area, find the bucket and scope where you want to create a collection.
-
Next to the scope name where you want to create a collection, go to .
-
In the Collection Name field, enter a collection name.
A collection name can only contain the
A-Z,a-z, and0-9characters as well as the-,_, and%symbols. It cannot start with either the_or%symbols. It cannot be longer than 251 characters in length and is case-sensitive. -
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 information about collection expiration, see Expiration.
-
Click Create Collection.
Delete a Collection
To delete a collection, you need the Project Owner or Cluster 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. |
-
Go to the Operational tab and click your cluster name.
-
Go to Data Tools.
-
In the side pane, expand Data to open the Data Insights area.
-
In the Data Insights area, find the bucket and scope where you want to delete a collection.
-
Next to the collection name you want to delete, go to .
-
Confirm that you want to delete the collection.
-
Click Delete.