Skip to content

Commit 777fc6a

Browse files
committed
chore: migrate from Motor to PyMongo async
1 parent c3f5c25 commit 777fc6a

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

backend/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from fastapi import FastAPI
22
import uvicorn
3-
from motor.motor_asyncio import AsyncIOMotorClient
3+
from pymongo import AsyncMongoClient
44
from config import settings
55

66
from apps.todo.routers import router as todo_router
@@ -10,7 +10,7 @@
1010

1111
@app.on_event("startup")
1212
async def startup_db_client():
13-
app.mongodb_client = AsyncIOMotorClient(settings.DB_URL)
13+
app.mongodb_client = AsyncMongoClient(settings.DB_URL)
1414
app.mongodb = app.mongodb_client[settings.DB_NAME]
1515

1616

backend/requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ fastapi
33
pydantic
44

55
# Database
6-
motor[srv]
6+
pymongo[srv]
77

88
# Development
99
pip-tools

backend/requirements.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ markupsafe==2.1.5
5858
# via jinja2
5959
mdurl==0.1.2
6060
# via markdown-it-py
61-
motor[srv]==3.4.0
62-
# via -r requirements.in
6361
mypy-extensions==1.0.0
6462
# via black
6563
orjson==3.10.3
@@ -82,8 +80,8 @@ pydantic-core==2.18.4
8280
# via pydantic
8381
pygments==2.18.0
8482
# via rich
85-
pymongo[srv]==4.7.3
86-
# via motor
83+
pymongo[srv]==4.13.1
84+
# via -r requirements.in
8785
pyproject-hooks==1.1.0
8886
# via
8987
# build

0 commit comments

Comments
 (0)