cowbird.database.mongodb

Module Contents

Classes

MongoDatabase

Return the unique identifier of db type matching settings.

Functions

get_mongodb_connection(→ pymongo.database.Database)

Obtains the basic database connection from settings.

get_mongodb_engine(→ 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: cowbird.typedefs.AnySettingsContainer)[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(store_type)[source]
get_store(store_type: Union[str, Type[cowbird.database.stores.StoreInterface], AnyMongodbStoreType], *store_args: Any, **store_kwargs: Any)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()Any[source]
get_information()cowbird.typedefs.JSON[source]
Returns

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

is_ready()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.