请问有人可以告诉我如何在 fastapi 中执行此操作吗?
样本集
用户收藏:
{
"_id" : "object ID",
"name": " str",
"email": " str"
}
用户个人资料收集:
{
"_id" : "object ID",
"first_name": "str",
"last_name": "str"
}
公司收藏:
{
"_id" : "object ID",
" name" : "str",
" dept" : "str"
}
问题:
我在 Motor 之上为 MongoDB 构建了一个异步 ODM,称为“motormongo”。它具有与 mongoengine 类似的 API。使 mongoengine 用户能够轻松过渡到使用 motormongo 异步功能。它专为在 FastAPI 项目中使用而设计。您可以在这里找到源代码:https://github.com/pprunty/motormongo和文档:https://motormongo.readthedocs.io/en/latest/。希望这有帮助!