Added db_client_sync
This commit is contained in:
parent
a1acaed6dd
commit
7011baff0f
@ -1,5 +1,5 @@
|
|||||||
from async_pymongo import AsyncClient
|
from async_pymongo import AsyncClient
|
||||||
from pymongo import GEOSPHERE
|
from pymongo import GEOSPHERE, MongoClient
|
||||||
|
|
||||||
from modules.utils import configGet
|
from modules.utils import configGet
|
||||||
|
|
||||||
@ -19,6 +19,7 @@ else:
|
|||||||
)
|
)
|
||||||
|
|
||||||
db_client = AsyncClient(con_string)
|
db_client = AsyncClient(con_string)
|
||||||
|
db_client_sync = MongoClient(con_string)
|
||||||
|
|
||||||
db = db_client.get_database(name=db_config["name"])
|
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_tokens = db.get_collection("tokens")
|
||||||
col_emails = db.get_collection("emails")
|
col_emails = db.get_collection("emails")
|
||||||
|
|
||||||
col_photos.create_index([("location", GEOSPHERE)])
|
db_client_sync[db_config["name"]]["photos"].create_index([("location", GEOSPHERE)])
|
||||||
|
Loading…
Reference in New Issue
Block a user