Reputation: 141
I am using PHP mongoDB driver ver 1.1.8 My PHP code for establishing a connection to MongoDB goes like this
$conn=new MongoDB\Client("mongodb://localhost:27017");
But the problem is , each time a client refresh the page a new connection is established. Therefore i want to close the connection at the end of the PHP script.
Earlier i used to close a connection with this code
$conn->close();
But this is not working in the new PHP MongoDB drivers.
Upvotes: 4
Views: 8330