Tags

#mongodb
mongodb

2stories
5 d agolatest
MongoDB driver 3.12
Who owns shutdown

MongoClient in ASP.NET Core: lifetime and shutdown ownership

The article explains how to register MongoClient as a singleton in ASP.NET Core and how request-scoped services should borrow it. It shows that disposing the client through the container does not close the driver's cluster, and that the selected driver version changes the answer. It is a useful reference for teams running MongoDB in web apps.

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message