2024-02-15 00:17:51 +03:30
|
|
|
from pymongo.collection import Collection
|
|
|
|
|
|
|
|
|
|
from config import conf
|
|
|
|
|
from core.service.mongo_db import use_collection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_auth_db():
|
2026-02-17 23:52:14 +03:30
|
|
|
return conf.server.is_prod and conf.database.get('mongo_auth').production.db or conf.database.get(
|
|
|
|
|
'mongo_auth').dev.db
|
2024-02-15 00:17:51 +03:30
|
|
|
|
|
|
|
|
|
|
|
|
|
def use_auth_collection(collection: str) -> Collection:
|
|
|
|
|
return use_collection(collection, get_auth_db(), connection_name='mongo_auth')
|