A newer version of this documentation is available.

View Latest

DROP SCOPE

  • reference
  • Couchbase Server 7.0
    +
    The DROP SCOPE statement enables you to delete a scope.

    Syntax

    drop-scope ::= DROP SCOPE [ namespace ':' ] bucket '.' scope
    drop-scope ::= 'DROP' 'SCOPE' ( namespace ':' )? bucket '.' scope
    namespace

    (Optional) An identifier that refers to the namespace of the bucket which contains the scope you want to delete. Currently, only the default namespace is available. If the namespace name is omitted, the default namespace in the current session is used.

    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.

    Usage

    When you delete a scope, any collections within that scope are deleted also.

    Example

    This statement deletes a scope called events in the travel-sample bucket.

    DROP SCOPE `travel-sample`.events