CREATE SCOPEstatement enables you to create a scope.
create-scope ::= 'CREATE' 'SCOPE' ( namespace ':' )? bucket '.' scope ( 'IF' 'NOT' 'EXISTS' )?
(Optional) An identifier that refers to the namespace of the bucket in which you want to create the scope. Currently, only the
defaultnamespace is available. If the namespace name is omitted, the default namespace in the current session is used.
(Required) An identifier that refers to the bucket in which you want to create the scope.
If there is a hyphen (-) inside the bucket name or the scope name, you must wrap that part of the path in backticks (` `).
IF NOT EXISTS clause enables the statement to complete successfully when the specified scope already exists.
If a scope with the same name already exists 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.
This statement creates a scope called
events in the
CREATE SCOPE `travel-sample`.events
An overview of scopes and collections is provided in Scopes and Collections.
Step-by-step procedures for management are provided in Manage Scopes and Collections.
Refer to Scopes and Collections API to manage scopes and collections with the REST API.
Refer to the reference page for the collection-manage command to manage scopes and collections with the CLI.