14 lines
400 B
Python
14 lines
400 B
Python
from pymongo.collection import Collection
|
|
|
|
from config import conf
|
|
from core.service.mongo_db import use_collection
|
|
|
|
|
|
def get_auth_db():
|
|
return conf.server.is_prod and conf.database.get('mongo').production.db or conf.database.get(
|
|
'mongo').dev.db
|
|
|
|
|
|
def use_auth_collection(collection: str) -> Collection:
|
|
return use_collection(collection, get_auth_db(), connection_name='mongo_auth')
|