def adapter(request, pymongo_client): """Get an adapter connected to mongo database""" LOG.info("Connecting to database...") mongo_client = pymongo_client database = mongo_client[DATABASE] mongo_adapter = PymongoAdapter(database) LOG.info("Connected to database") return mongo_adapter
def real_adapter(request, real_pymongo_client): """Get an adapter connected to mongo database""" logger.info("Connecting to database...") mongo_client = real_pymongo_client database = mongo_client[REAL_DATABASE] mongo_adapter = PymongoAdapter(database) logger.info("Connected to database") return mongo_adapter
def real_adapter(request, real_pymongo_client): """Get an adapter connected to mongo database""" mongo_client = real_pymongo_client LOG.info("Connecting to database %s", REAL_DATABASE) database = mongo_client[REAL_DATABASE] mongo_adapter = PymongoAdapter(database) mongo_adapter.load_indexes() LOG.info("Connected to database") return mongo_adapter