Skip to content

Recommended way to use mongodb with FastAPI #452

Description

@Ayush1325

I am playing around with FastAPI a bit and wanted to connect it to a MongoDB database. I, however, am confused which ODM to choose between motor which is async and mongoengine. Also, in the NoSQL example they have created a new bucket and also the called the code to connect to DB every time it is used. However, both motor and mongoengine seem to prefer a global connection. So what would be a good way to connect to MongoDB?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions