mongodb-developer / pymongo-fastapi-crud

PyMongo with FastAPI CRUD application
Apache License 2.0
131 stars 46 forks source link

close db after dropping collection #2

Open knoguchi opened 1 year ago

knoguchi commented 1 year ago

The shutdown event handler should close the mongodb connection after dropping the collection. The problem is more apparent with Pymongo4. With Pymongo4 the unit test fails with "Cannot use MongoClient after close" error.