Update mongo_impl.py
Browse files- lightrag/kg/mongo_impl.py +7 -12
lightrag/kg/mongo_impl.py
CHANGED
@@ -25,18 +25,13 @@ if not pm.is_installed("pymongo"):
|
|
25 |
if not pm.is_installed("motor"):
|
26 |
pm.install("motor")
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
from pymongo.errors import PyMongoError
|
36 |
-
except ImportError as e:
|
37 |
-
raise ImportError(
|
38 |
-
"`motor, pymongo` library is not installed. Please install it via pip: `pip install motor pymongo`."
|
39 |
-
) from e
|
40 |
|
41 |
config = configparser.ConfigParser()
|
42 |
config.read("config.ini", "utf-8")
|
|
|
25 |
if not pm.is_installed("motor"):
|
26 |
pm.install("motor")
|
27 |
|
28 |
+
from motor.motor_asyncio import (
|
29 |
+
AsyncIOMotorClient,
|
30 |
+
AsyncIOMotorDatabase,
|
31 |
+
AsyncIOMotorCollection,
|
32 |
+
)
|
33 |
+
from pymongo.operations import SearchIndexModel
|
34 |
+
from pymongo.errors import PyMongoError
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
config = configparser.ConfigParser()
|
37 |
config.read("config.ini", "utf-8")
|