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?
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?