Do I need to explicitly close connection?

No, you do not need to close connections to DB – your only connection is via MongoClient and as the documentation states – it handles connection pooling for you.

The only resource that you would want to clean up would be a cursor which you should close() when you’re done with it.

Leave a Comment