diff --git a/modules/database.py b/modules/database.py index 65fe87d..405c55c 100644 --- a/modules/database.py +++ b/modules/database.py @@ -1,5 +1,5 @@ from async_pymongo import AsyncClient -from pymongo import GEOSPHERE +from pymongo import GEOSPHERE, MongoClient from modules.utils import configGet @@ -19,6 +19,7 @@ else: ) db_client = AsyncClient(con_string) +db_client_sync = MongoClient(con_string) db = db_client.get_database(name=db_config["name"]) @@ -29,4 +30,4 @@ col_videos = db.get_collection("videos") col_tokens = db.get_collection("tokens") col_emails = db.get_collection("emails") -col_photos.create_index([("location", GEOSPHERE)]) +db_client_sync[db_config["name"]]["photos"].create_index([("location", GEOSPHERE)])