When you are developing application and making a connection to mongodb database, you use single instance of connection for all database operation in an entire application, so it doesn't matter whether you close a connection or not. read more
But for an instance you are running a test cases for a same application each time you open a new connection and perform a operation for each test cases, in this scenario if you don't close a connection at the end of each test cases, the connections will get piled up and you will run short of memory. read more