cowbird.database.mongodb ======================== .. py:module:: cowbird.database.mongodb Attributes ---------- .. autoapisummary:: cowbird.database.mongodb.MongoDB cowbird.database.mongodb.MongodbStores cowbird.database.mongodb.AnyMongodbStore cowbird.database.mongodb.AnyMongodbStoreType Classes ------- .. autoapisummary:: cowbird.database.mongodb.MongoDatabase Functions --------- .. autoapisummary:: cowbird.database.mongodb.get_mongodb_connection cowbird.database.mongodb.get_mongodb_engine Module Contents --------------- .. py:data:: MongoDB :type: Optional[pymongo.database.Database] :value: None .. py:data:: MongodbStores .. py:data:: AnyMongodbStore .. py:data:: AnyMongodbStoreType .. py:class:: MongoDatabase(container: cowbird.typedefs.AnySettingsContainer) Bases: :py:obj:`cowbird.database.base.DatabaseInterface` Return the unique identifier of db type matching settings. Initialize the mongo database from various type of container. .. py:attribute:: _database :type: pymongo.database.Database :value: None .. py:attribute:: _settings :type: cowbird.typedefs.SettingsType :value: None .. py:attribute:: _stores :type: Dict[str, AnyMongodbStore] :value: None .. py:attribute:: type :value: 'mongodb' .. py:method:: reset_store(store_type: AnyMongodbStoreType) -> Optional[AnyMongodbStore] .. py:method:: get_store(store_type: Union[str, Type[cowbird.database.stores.StoreInterface], AnyMongodbStoreType], *store_args: Any, **store_kwargs: Any) -> AnyMongodbStore Retrieve a store from the database. :param store_type: type of the store to retrieve/create. :param store_args: additional arguments to pass down to the store. :param store_kwargs: additional keyword arguments to pass down to the store. .. py:method:: get_session() -> Any .. py:method:: get_information() -> cowbird.typedefs.JSON :returns: {'version': version, 'type': db_type} .. py:method:: is_ready() -> bool .. py:function:: get_mongodb_connection(container: cowbird.typedefs.AnySettingsContainer) -> pymongo.database.Database Obtains the basic database connection from settings. .. py:function:: get_mongodb_engine(container: cowbird.typedefs.AnySettingsContainer) -> pymongo.database.Database Obtains the database with configuration ready for usage.