Connect to MongoDB

suggest change

Create a connection with the mongodb extension. Later pages query through this manager:

$manager = new \MongoDB\Driver\Manager('mongodb://localhost:27017');

In the next example, you will learn how to query the connection object.

The extension closes the connection when the request ends. You do not need to close it yourself.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents