cowbird.database.mongodb

Module Contents

Classes

MongoDatabase

Return the unique identifier of db type matching settings.

Functions

get_mongodb_connection(container: cowbird.typedefs.AnySettingsContainer) → pymongo.database.Database

Obtains the basic database connection from settings.

get_mongodb_engine(container: cowbird.typedefs.AnySettingsContainer) → pymongo.database.Database

Obtains the database with configuration ready for usage.

Attributes

MongoDB

MongodbStores

AnyMongodbStore

cowbird.database.mongodb.MongoDB :Optional[Database][source]
cowbird.database.mongodb.MongodbStores[source]
cowbird.database.mongodb.AnyMongodbStore[source]
class cowbird.database.mongodb.MongoDatabase(container)[source]

Bases: cowbird.database.base.DatabaseInterface

Return the unique identifier of db type matching settings.

Initialize the mongo database from various type of container.

_database[source]
_settings[source]
_stores[source]
type = mongodb[source]
reset_store(self, store_type)[source]
get_store(self: Union[str, Type[cowbird.database.stores.StoreInterface], AnyMongodbStoreType], store_type: Any, *store_args: Any, **store_kwargs)AnyMongodbStore[source]

Retrieve a store from the database.

Parameters
  • store_type – type of the store to retrieve/create.

  • store_args – additional arguments to pass down to the store.

  • store_kwargs – additional keyword arguments to pass down to the store.

get_session(self: Ellipsis)Any[source]
get_information(self: Ellipsis)cowbird.typedefs.JSON[source]
Returns

{‘version’: version, ‘type’: db_type}

is_ready(self: Ellipsis)bool[source]
cowbird.database.mongodb.get_mongodb_connection(container: cowbird.typedefs.AnySettingsContainer)pymongo.database.Database[source]

Obtains the basic database connection from settings.

cowbird.database.mongodb.get_mongodb_engine(container: cowbird.typedefs.AnySettingsContainer)pymongo.database.Database[source]

Obtains the database with configuration ready for usage.