updated the mongo_url to dsqls new url/small type hint fixes
This commit is contained in:
1 parent
1218ba0b3c
commit
39a6c40154
4 files changed
+28
-9
No files matched your search
@@ -30,13 +30,17 @@ NEW_LISTING_PRIORITY = 6
|
||||
|
||||
|
||||
def get_collection(
|
||||
collection_name: str, mongo_client: AsyncIOMotorClient = None
|
||||
collection_name: str,
|
||||
mongo_client: AsyncIOMotorClient = None,
|
||||
database_name=MONGO_DATABASE_NAME,
|
||||
) -> AsyncIOMotorCollection:
|
||||
# rename mongo_client to client and add optional database name arg
|
||||
"""Return the named collection from the shared client's database.
|
||||
|
||||
Args:
|
||||
collection_name: Name of the collection to return.
|
||||
mongo_client: optional client for projects with already configured client
|
||||
database_name: optional name to use besides the default mongo database name
|
||||
|
||||
Returns:
|
||||
The requested collection.
|
||||
@@ -45,7 +49,7 @@ def get_collection(
|
||||
if mongo_client is None:
|
||||
mongo_client = get_mongo_client()
|
||||
|
||||
return mongo_client[MONGO_DATABASE_NAME][collection_name]
|
||||
return mongo_client[database_name][collection_name]
|
||||
|
||||
|
||||
def resolve_alerts_collection(
|
||||
|
||||
Reference in new issue
Block a user