Collections
- class txcouchbase.management.collections.CollectionManager(impl: TxCollectionMgmtInterface)
Performs management operations on a bucket’s scopes and collections.
- create_collection(collection: CollectionSpec, options: CreateCollectionOptions | None = None, **kwargs: Unpack[CreateCollectionOptionsKwargs]) Deferred[None]
- create_collection(scope_name: str, collection_name: str, settings: CreateCollectionSettings | None = None, options: CreateCollectionOptions | None = None, **kwargs: Unpack[CreateCollectionOptionsKwargs]) Deferred[None]
Creates a new collection in a specified scope.
Deprecated since version 4.1.9: The overload that takes a
CollectionSpecis deprecated; passscope_nameandcollection_nameinstead.- Parameters:
scope_name (str) – The name of the scope the collection will be created in.
collection_name (str) – The name of the collection to be created
settings (
CreateCollectionSettings, optional) – Settings to apply for the collectionoptions (
CreateCollectionOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Returns:
An empty Deferred instance.
- Return type:
Deferred
- Raises:
CollectionAlreadyExistsException – If the collection already exists.
ScopeNotFoundException – If the scope does not exist.
- create_scope(scope_name: str, options: CreateScopeOptions | None = None, **kwargs: Unpack[CreateScopeOptionsKwargs]) Deferred[None]
Creates a new scope.
- Parameters:
scope_name (str) – The name of the scope.
options (
CreateScopeOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Returns:
An empty Deferred instance.
- Return type:
Deferred
- Raises:
ScopeAlreadyExistsException – If the scope already exists.
- drop_collection(collection: CollectionSpec, options: DropCollectionOptions | None = None, **kwargs: Unpack[DropCollectionOptionsKwargs]) Deferred[None]
- drop_collection(scope_name: str, collection_name: str, options: DropCollectionOptions | None = None, **kwargs: Unpack[DropCollectionOptionsKwargs]) Deferred[None]
Drops a collection from a scope.
Deprecated since version 4.1.9: The overload that takes a
CollectionSpecis deprecated; passscope_nameandcollection_nameinstead.- Parameters:
scope_name (str) – The name of the scope the collection is in.
collection_name (str) – The name of the collection to be dropped.
options (
DropCollectionOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Returns:
An empty Deferred instance.
- Return type:
Deferred
- Raises:
CollectionNotFoundException – If the collection does not exist.
- drop_scope(scope_name: str, options: DropScopeOptions | None = None, **kwargs: Unpack[DropScopeOptionsKwargs]) Deferred[None]
Drops an existing scope.
- Parameters:
scope_name (str) – The name of the scope.
options (
DropScopeOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Returns:
An empty Deferred instance.
- Return type:
Deferred
- Raises:
ScopeNotFoundException – If the scope does not exist.
- get_all_scopes(options: GetAllScopesOptions | None = None, **kwargs: Unpack[GetAllScopesOptionsKwargs]) Deferred[Iterable[ScopeSpec]]
Returns all configured scopes along with their collections.
- Parameters:
options (
GetAllScopesOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Returns:
A list of all configured scopes.
- Return type:
Deferred[Iterable[
ScopeSpec]]
- update_collection(scope_name: str, collection_name: str, settings: UpdateCollectionSettings, options: UpdateCollectionOptions | None = None, **kwargs: Unpack[UpdateCollectionOptionsKwargs]) Deferred[None]
Updates a collection in a specified scope.
- Parameters:
scope_name (str) – The name of the scope the collection is in.
collection_name (str) – The name of the collection that will be updated
settings (
UpdateCollectionSettings) – Settings to apply for the collectionoptions (
UpdateCollectionOptions) – Optional parameters for this operation.**kwargs – keyword arguments that can be used as optional parameters for this operation.
- Returns:
An empty Deferred instance.
- Return type:
Deferred
- Raises:
CollectionNotFoundException – If the collection does not exist.
ScopeNotFoundException – If the scope does not exist.
This module also publishes these, described where they are first documented: