Skip to content

Commit 1e7ef5a

Browse files
committed
Define mongodb type..
2 parents df18ab0 + c5b31d5 commit 1e7ef5a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Create Release
1+
name: Python Micro Framework Data Release
22

33
on:
44
push:
@@ -13,5 +13,5 @@ jobs:
1313
env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1515
with:
16-
bump_version_scheme: minor
16+
bump_version_scheme: norelease
1717
tag_prefix: v

pymfdata/mongodb/repository.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from abc import ABC
22
from bson import ObjectId
3-
from typing import final, Optional
3+
from typing import final, List, Optional
44

55
from pymfdata.mongodb.connection import AsyncMotor
66

@@ -18,7 +18,7 @@ async def delete_by_id(self, item_id: str) -> bool:
1818
return True
1919

2020
@final
21-
async def find_all(self):
21+
async def find_all(self) -> List[dict]:
2222
cursor = self._collection.find()
2323
results = list(map(lambda item: item, await cursor.to_list(length=100)))
2424

@@ -33,10 +33,10 @@ async def find_by_id(self, item_id: str) -> Optional[dict]:
3333
return row
3434

3535
@final
36-
async def save(self, req: dict):
36+
async def save(self, req: dict) -> dict:
3737
return await self._collection.insert_one(req)
3838

3939
@final
40-
async def update_by_id(self, item_id: str, req: dict):
40+
async def update_by_id(self, item_id: str, req: dict) -> dict:
4141
await self._collection.update_one({"_id": ObjectId(item_id)}, req)
4242
return await self.find_by_id(item_id)

0 commit comments

Comments
 (0)