This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```python | |
from motor.motor_asyncio import AsyncIOMotorClient | |
from odmantic import AIOEngine | |
client = AsyncIOMotorClient("mongodb://localhost:27017") | |
engine = AIOEngine(motor_client=client, database="test_db") | |
def odmantic_to_pydantic(document: MyDocument) -> DocumentResponse: | |
return DocumentResponse(id=str(document.id), data=document.data, latest_version=document.latest_version) |