We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff24b15 commit 8ec98cdCopy full SHA for 8ec98cd
app.py
@@ -9,15 +9,16 @@
9
from typing_extensions import Annotated
10
11
from bson import ObjectId
12
-import motor.motor_asyncio
+import asyncio
13
+from pymongo import AsyncMongoClient
14
from pymongo import ReturnDocument
15
16
17
app = FastAPI(
18
title="Student Course API",
19
summary="A sample application showing how to use FastAPI to add a ReST API to a MongoDB collection.",
20
)
-client = motor.motor_asyncio.AsyncIOMotorClient(os.environ["MONGODB_URL"])
21
+client = AsyncMongoClient(os.environ["MONGODB_URL"])
22
db = client.college
23
student_collection = db.get_collection("students")
24
0 commit comments