Update mongo_impl.py
This commit is contained in:
@@ -25,18 +25,13 @@ if not pm.is_installed("pymongo"):
|
|||||||
if not pm.is_installed("motor"):
|
if not pm.is_installed("motor"):
|
||||||
pm.install("motor")
|
pm.install("motor")
|
||||||
|
|
||||||
try:
|
from motor.motor_asyncio import (
|
||||||
from motor.motor_asyncio import (
|
AsyncIOMotorClient,
|
||||||
AsyncIOMotorClient,
|
AsyncIOMotorDatabase,
|
||||||
AsyncIOMotorDatabase,
|
AsyncIOMotorCollection,
|
||||||
AsyncIOMotorCollection,
|
)
|
||||||
)
|
from pymongo.operations import SearchIndexModel
|
||||||
from pymongo.operations import SearchIndexModel
|
from pymongo.errors import PyMongoError
|
||||||
from pymongo.errors import PyMongoError
|
|
||||||
except ImportError as e:
|
|
||||||
raise ImportError(
|
|
||||||
"`motor, pymongo` library is not installed. Please install it via pip: `pip install motor pymongo`."
|
|
||||||
) from e
|
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read("config.ini", "utf-8")
|
config.read("config.ini", "utf-8")
|
||||||
|
Reference in New Issue
Block a user