DROP SCOPE
- Capella Operational
- reference
The DROP SCOPE
statement enables you to delete a scope.
Syntax
drop-scope ::= 'DROP' 'SCOPE' ( namespace ':' )? bucket '.' scope ( 'IF' 'EXISTS' )?

namespace |
(Optional) An identifier that refers to the namespace of the bucket which contains the scope you want to delete.
Currently, only the |
bucket |
(Required) An identifier that refers to the bucket which contains the scope you want to delete. |
scope |
(Required) An identifier that refers to the name of the scope that you want to delete. |
If there is a hyphen (-) inside the bucket name or the scope name, you must wrap that part of the path in backticks (` `).
For example, default:`travel-sample` indicates the travel-sample keyspace in the default namespace.
|
IF EXISTS Clause
The optional IF EXISTS
clause enables the statement to complete successfully when the specified scope doesn’t exist.
If the scope does not exist within the specified bucket, then:
-
If this clause is not present, an error is generated.
-
If this clause is present, the statement does nothing and completes without error.
Example
This statement deletes a scope called events
in the travel-sample
bucket.
DROP SCOPE `travel-sample`.events
Related Links
-
For an overview of scopes and collections, see Buckets, Scopes, and Collections.
-
For step-by-step management procedures, see Manage Scopes and Collections.
-
To manage scopes and collections with the Management API, see Buckets, Scopes, and Collections.
-
To manage scopes and collections with the Couchbase Shell, see Couchbase Shell Documentation.