Manage Scopes and Collections
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 database 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 database:
-
With the Projects tab in your organization open, click the project with the database you’re working with.
-
With the Databases tab open, select your database.
-
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 database 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 database where you’re creating the scope.
-
Open the Buckets page for your database:
-
With the Projects tab in your organization open, click the project with the database you’re working with.
-
With the Databases tab open, select your database.
-
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 database where you’re deleting a scope.
Deleting a scope deletes all of the collections and documents in that scope from the database. You can only restore them from a previous backup. |
-
Open the Buckets page for your database:
-
With the Projects tab in your organization open, click the project with the database you’re working with.
-
With the Databases tab open, select your database.
-
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 database:
-
With the Projects tab in your organization open, click the project with the database you’re working with.
-
With the Databases tab open, select your database.
-
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 database where you’re creating the collection.
-
Open the Buckets page for your database:
-
With the Projects tab in your organization open, click the project with the database you’re working with.
-
With the Databases tab open, select your database.
-
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.
You can’t change a collection’s TTL after you create it. Make sure this value matches your requirements.
In the TTL (Time To Live) in seconds field, enter an expiration time for the new collection. By default, this field is set to
0
, indicating that no expiration time is applied. 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 database where you’re deleting the collection.
Deleting a collection deletes all of the documents within it from the database. You can restore these documents from a previous backup. |
-
Open the Buckets page for your database:
-
With the Projects tab in your organization open, click the project with the database you’re working with.
-
With the Databases tab open, select your database.
-
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.
-