I'm holding one instance of MongoClient
and DB
in my application, and every time that I want to execute some operation I call getCollection()
.
I'm wondering if I need to explicitly close the connection, just like connection.close()
in JDBC.
To emphasize, I have only one MongoClient
instance. My question is not about closing MongoClient
but closing the connections I believe it opens when I'm calling getCollection()
.